Bueno esto es parte del smoker que estoy haciendo pero tengo un error , el cual es que ejemplo
si uso la habilidad y fallo y sigo apretando la R , cuando vuelve a pasar el delay ( 5 segundos ) y suelto y vuelvo a apretar no lanza de nuevo la habilidad ni nada.
PHP Code:
public player_prethink(id)
{
if(!is_user_alive(id))
return
static iButton; iButton = pev(id, pev_button)
static iOldButton; iOldButton = pev(id, pev_oldbuttons)
if(is_zombie(id))
{
if((iButton & IN_RELOAD) && !(iOldButton & IN_RELOAD))
{
new hooktarget, body
if((get_gametime() - last_catch[id]) <= 4.9)
{
print_chatColor(id , "^x04[ZPC]^x01 Espera^x04 %.1f Seg^x01 Para Volver A Usar^x04 Tu Lengua." , 5.0 - (get_gametime() - last_catch[id]))
return
}
get_user_aiming(id , hooktarget , body)
if(is_player(hooktarget) && is_user_alive(hooktarget) && !zp_get_user_zombie(hooktarget))
{
g_catched[id] = hooktarget
emit_sound(id , CHAN_BODY , sound[1] , 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(0.1 , "catch_player" , id+TASK_CATCH , _ , _ , "b")
return
}
new endorigin[3]
get_user_origin(id, endorigin, 3)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte( TE_BEAMENTPOINT )
write_short(id)
write_coord(endorigin[0])
write_coord(endorigin[1])
write_coord(endorigin[2])
write_short(beam)
write_byte(0)
write_byte(0)
write_byte(1)
write_byte(15)
write_byte(1)
write_byte(255)
write_byte(0)
write_byte(150)
write_byte(200)
write_byte(0)
message_end()
print_chatColor(id , "^x04[ZPC]^x01 Has Fallado , Intenta Nuevamente En^x04 5.0 Segundos.")
emit_sound(id , CHAN_BODY , sound[0] , 1.0, ATTN_NORM, 0, PITCH_NORM)
reset(id)
}
if(iOldButton & IN_RELOAD && !(iButton & IN_RELOAD))
{
if((get_gametime() - last_catch[id]) <= 4.9)
return
reset(id)
}
if(g_catched[id])
set_pev(id , pev_maxspeed , 0.1)
}
return
}
public reset(id)
{
last_catch[id] = get_gametime()
g_catched[id] = 0
remove_task(id+TASK_CATCH)
}