User
Pass
2FA
 
 

Modificare .SMA

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message1294
DRYincing07

[Mentally Stable]



Status: Offline
(since 11-02-2019 15:09)
Joined: 02 Feb 2017
Posts: 40, Topics: 13
Location: Romania

Reputation: 18.3
Votes: 1

Post Posted: 22-08-2017, 22:39:53 | Translate post to: ... (Click for more languages)

»Nume*: smokerv5.
»Descriere problema*: Are ca setare un interval intre 0 si o secunda cand trage oamenii. Doresc o sa se adauge si intervalul de 0.5 (jumatate de secunda).
»Poze/Sma:
Spoiler: Ascunde
#include <amxmodx>
#include <biohazard>
#include <fakemeta>
#include <hamsandwich>
#include <engine>




// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI


#define VIATA_ZOMBIE 600.0
#define DISTANTA 500


// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI
// AICI SETEZI






#define PLUGIN "Class: Smoker (trage oamenii)"
#define AUTHOR "MaHu"
#define VERSION "0.1"

//Main Class, modelT & Sprite Beam
new g_Line

#define ICON_HIDE 0
#define ICON_SHOW 1
#define ICON_FLASH 2


//Sounds
new g_sndMiss[] = "left4dead/Smoker_TongueHit_miss.wav"
new g_sndDrag[] = "left4dead/Smoker_TongueHit_drag.wav"

//Some vars
new g_hooked[33], g_hooksLeft[33], g_unable2move[33], g_ovr_dmg[33]
new Float:g_lastHook[33]
new bool: g_drag_i[33] = false

//Cvars
new cvar_maxdrags, cvar_dragspeed, cvar_cooldown, cvar_dmg2stop, cvar_mates, cvar_unb2move

new g_class

public plugin_precache( )
{
precache_sound(g_sndDrag)
precache_sound(g_sndMiss)
g_Line = precache_model("sprites/zbeam4.spr")

}

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

cvar_dragspeed = register_cvar("smoker_dragspeed", "220")
cvar_maxdrags = register_cvar("smoker_maxdrags", "30")
cvar_cooldown = register_cvar("smoker_cooldown", "0")
cvar_dmg2stop = register_cvar("smoker_dmg2stop", "16")
cvar_mates = register_cvar("smoker_mates", "0")
cvar_unb2move = register_cvar("smoker_unable_move", "1")

register_event("ResetHUD", "newSpawn", "b")
register_event("DeathMsg", "smoker_death", "a")

register_forward(FM_CmdStart, "FwdCmdStart");

RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

g_class = register_class("Smoker (trage oamenii)", "pe E")
if(g_class != -1)
{
set_class_data(g_class, DATA_HEALTH, VIATA_ZOMBIE)
set_class_data(g_class, DATA_SPEED, 290.0)
set_class_data(g_class, DATA_GRAVITY, 1.0)
set_class_data(g_class, DATA_DEFENCE, 0.087)
set_class_data(g_class, DATA_HITSPEED, 0.95)
set_class_data(g_class, DATA_HITDELAY, 0.15)
set_class_data(g_class, DATA_REGENDLY, 0.20)
set_class_data(g_class, DATA_HITREGENDLY, 2.2)
set_class_data(g_class, DATA_KNOCKBACK, 0.0)
}
}

public event_infect(victim, attacker)
{
if(get_user_class(victim) == g_class)
{
g_hooksLeft[victim] = get_pcvar_num(cvar_maxdrags)
}

if(is_user_zombie(victim) && g_hooked[victim])
{
drag_end(victim)
}
}

public newSpawn(id)
{
if (g_hooked[id])
drag_end(id)
}

public drag_start(id) // starts drag, checks if player is Smoker, checks cvars
{
if (is_user_zombie(id) && (get_user_class(id) == g_class) && !g_drag_i[id]) {

static Float:cdown
cdown = get_pcvar_float(cvar_cooldown)
if (!is_user_alive(id)) {
client_print(id, print_chat, "Nu poti trage mort!")
return PLUGIN_HANDLED
}
if (g_hooksLeft[id] <= 0) {
client_print(id, print_chat, "Nu poti trage!")
return PLUGIN_HANDLED
}
if (get_gametime() - g_lastHook[id] < cdown) {
client_print(id, print_chat, "Asteapta %.f0 sec.!", get_pcvar_float(cvar_cooldown) - (get_gametime() - g_lastHook[id]))
return PLUGIN_HANDLED
}

new hooktarget, body
get_user_aiming(id, hooktarget, body, DISTANTA)
if(DISTANTA < 400.0)
{
client_print(id, print_chat, "Nu esti la distanta necesara!");
return PLUGIN_HANDLED;
}

if (is_user_alive(hooktarget)) {
if (!is_user_zombie(hooktarget))
{

g_hooked[id] = hooktarget
emit_sound(hooktarget, CHAN_BODY, g_sndDrag, 1.0, ATTN_NORM, 0, PITCH_HIGH)
}
else
{
if (get_pcvar_num(cvar_mates) == 1)
{
g_hooked[id] = hooktarget
emit_sound(hooktarget, CHAN_BODY, g_sndDrag, 1.0, ATTN_NORM, 0, PITCH_HIGH)
}
else
{
client_print(id, print_chat, "Este coechipier!")
return PLUGIN_HANDLED
}
}
if (get_pcvar_float(cvar_dragspeed) <= 0.0)
cvar_dragspeed = 1

new parm[2]
parm[0] = id
parm[1] = hooktarget

set_task(0.1, "smoker_reelin", id, parm, 2, "b")
harpoon_target(parm)

g_hooksLeft[id]--
client_print(id, print_chat, "Poti trage de %d time%s", g_hooksLeft[id], (g_hooksLeft[id] < 2) ? "" : "s")
g_drag_i[id] = true

if(get_pcvar_num(cvar_unb2move) == 1)
g_unable2move[hooktarget] = true

if(get_pcvar_num(cvar_unb2move) == 2)
g_unable2move[id] = true

if(get_pcvar_num(cvar_unb2move) == 3)
{
g_unable2move[hooktarget] = true
g_unable2move[id] = true
}
} else {
g_hooked[id] = 33
noTarget(id)
emit_sound(hooktarget, CHAN_BODY, g_sndMiss, 1.0, ATTN_NORM, 0, PITCH_HIGH)
g_drag_i[id] = true
g_hooksLeft[id]--
client_print(id, print_chat, "Poti trage de %d time%s", g_hooksLeft[id], (g_hooksLeft[id] < 2) ? "" : "s")
}
}
else
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public smoker_reelin(parm[]) // dragging player to smoker
{
new id = parm[0]
new victim = parm[1]
if (!g_hooked[id] || !is_user_alive(victim) || is_user_zombie(victim))
{
drag_end(id)
return
}
new Float:fl_Velocity[3]
new idOrigin[3], vicOrigin[3]
get_user_origin(victim, vicOrigin)
get_user_origin(id, idOrigin)
new distance = get_distance(idOrigin, vicOrigin)
if (distance > 1) {
new Float:fl_Time = distance / get_pcvar_float(cvar_dragspeed)
fl_Velocity[0] = (idOrigin[0] - vicOrigin[0]) / fl_Time
fl_Velocity[1] = (idOrigin[1] - vicOrigin[1]) / fl_Time
fl_Velocity[2] = (idOrigin[2] - vicOrigin[2]) / fl_Time
} else {
fl_Velocity[0] = 0.0
fl_Velocity[1] = 0.0
fl_Velocity[2] = 0.0
}
entity_set_vector(victim, EV_VEC_velocity, fl_Velocity) //<- rewritten. now uses engine
}

public drag_end(id) // drags end function
{
g_hooked[id] = 0
beam_remove(id)
remove_task(id)

if (g_drag_i[id])
g_lastHook[id] = get_gametime()

g_drag_i[id] = false
g_unable2move[id] = false
}

public smoker_death() // if smoker dies drag off
{
new id = read_data(2)

beam_remove(id)

if (g_hooked[id])
drag_end(id)
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage) // if take damage drag off
{
if (is_user_alive(attacker) && (get_pcvar_num(cvar_dmg2stop) > 0))
{
g_ovr_dmg[victim] = g_ovr_dmg[victim] + floatround(damage)
if (g_ovr_dmg[victim] >= get_pcvar_num(cvar_dmg2stop))
{
g_ovr_dmg[victim] = 0
drag_end(victim)
return HAM_IGNORED;
}
}
return HAM_IGNORED;
}

public FwdCmdStart(id, uc_handle)
{
if (!is_user_alive(id) || !is_user_zombie(id))
return

static Button, OldButtons;
Button = get_uc(uc_handle, UC_Buttons);
OldButtons = pev(id, pev_oldbuttons);

if((Button & IN_USE) && (OldButtons & IN_USE))
{
drag_start(id)
}

if(!(Button & IN_USE) && (OldButtons & IN_USE))
{
drag_end(id)
}

if (!g_drag_i[id])
{
g_unable2move[id] = false
}

if (g_unable2move[id] && get_pcvar_num(cvar_unb2move) > 0)
{
set_pev(id, pev_maxspeed, 1.0)
}
}

public harpoon_target(parm[]) // set beam (ex. tongue:) if target is player
{
new id = parm[0]
new hooktarget = parm[1]
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(8) // TE_BEAMENTS
write_short(id)
write_short(hooktarget)
write_short(g_Line) // sprite index
write_byte(0) // start frame
write_byte(0) // framerate
write_byte(200) // life
write_byte(8) // width
write_byte(1) // noise
write_byte(155) // r, g, b
write_byte(155) // r, g, b
write_byte(55) // r, g, b
write_byte(90) // brightness
write_byte(10) // speed
message_end()
}

public noTarget(id) // set beam if target isn't player
{
new endorigin[3]
get_user_origin(id, endorigin, 3)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte( TE_BEAMENTPOINT ); // TE_BEAMENTPOINT
write_short(id)
write_coord(endorigin[0])
write_coord(endorigin[1])
write_coord(endorigin[2])
write_short(g_Line) // sprite index
write_byte(0) // start frame
write_byte(0) // framerate
write_byte(200) // life
write_byte(8) // width
write_byte(1) // noise
write_byte(155) // r, g, b
write_byte(155) // r, g, b
write_byte(55) // r, g, b
write_byte(75) // brightness
write_byte(0) // speed
message_end()
}

public beam_remove(id) // remove beam
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(99) //TE_KILLBEAM
write_short(id) //entity
message_end()
}


Multumesc anticipat

0 0
  
Back to top
View user's profile Send private message
destroi112

[DEV]



Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042, Topics: 119
Location: ---------

Reputation: 515.9
Votes: 118

   
Post Posted: 08-09-2017, 06:31:04 | Translate post to: ... (Click for more languages)

Modifica dragspeed-ul mai exact cvar-ul asta cvar_dragspeed = register_cvar("smoker_dragspeed", "220")
Pune 300 sau 350 dupa dai restart la server.



Retired from Amxmodx

0 0
  
Back to top
View user's profile Send private message
DRYincing07

[Mentally Stable]



Status: Offline
(since 11-02-2019 15:09)
Joined: 02 Feb 2017
Posts: 40, Topics: 13
Location: Romania

Reputation: 18.3
Votes: 1

Post Posted: 15-09-2017, 09:37:55 | Translate post to: ... (Click for more languages)

Acum incerc! O sa revin cu un reply.
0 0
  
Back to top
View user's profile Send private message
DRYincing07

[Mentally Stable]



Status: Offline
(since 11-02-2019 15:09)
Joined: 02 Feb 2017
Posts: 40, Topics: 13
Location: Romania

Reputation: 18.3
Votes: 1

Post Posted: 15-09-2017, 19:42:44 | Translate post to: ... (Click for more languages)

Merge! Multumesc!

0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by GoreSpintecatoru., 15 September 2017 17:49



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  


The time now is 26-04-2024, 19:58:02
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x