Zplague
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Zplague Entrar

Seu portal de Zombie Plague no Brasil


descriptionplugin class zm_climb Emptyplugin class zm_climb

more_horiz
preciso limitar a skill da classe zm climb ele está escalando infinitamente

preciso que limita ela para o uso somente de 5 segundos apos esse periodo esperar mais 5 segundos para usar novamente.

[ZP] You have to wait 5 seconds until you can go up again.

Código:

#include <amxmodx>
// #include <engine>
#include <fakemeta>

#include <cstrike>
#include <zombieplague.inc>

//#include <fakemeta_util>
#define STR_T           33

// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button)
/* stock fm_get_user_button(index)
 return pev(index, pev_button) */

#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
 return pev(index, pev_flags) */

stock fm_set_user_velocity(entity, const Float:vector[3]) {
 set_pev(entity, pev_velocity, vector);

 return 1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33]
new Float:g_wallorigin[32][3]
new cvar_zp_wallclimb, cvar_zp_wallclimb_nemesis, cvar_zp_wallclimb_survivor
new g_zclass_climb

// Climb Zombie Atributes
new const zclass_name[] = { "Climb Zombie" } // name
new const zclass_info[] = { "HP-- Speed+ Jump+ Knockback++" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 1200 // health
const zclass_speed = 220 // speed
const Float:zclass_gravity = 0.8 // gravity
const Float:zclass_knockback = 1.5 // knockback

public plugin_init()
{
 register_plugin("[ZP] Wallclimb ", "1.0", "WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
 register_forward(FM_Touch, "fwd_touch")
 register_forward(FM_PlayerPreThink, "fwd_playerprethink")
 //register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
 register_event("DeathMsg","EventDeathMsg","a")
 //register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
 cvar_zp_wallclimb = register_cvar("zp_wallclimb", "1")
 cvar_zp_wallclimb_survivor = register_cvar("zp_wallclimb_survivor", "0")
 cvar_zp_wallclimb_nemesis = register_cvar("zp_wallclimb_nemesis", "1")
 
}

public plugin_precache()
{
 g_zclass_climb = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public EventDeathMsg()
{
 new id = read_data(2)
 g_WallClimb[id] = true
 return PLUGIN_HANDLED
}

public client_connect(id) {
 g_WallClimb[id] = true
}

public fwd_touch(id, world)
{
 if(!is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
 return FMRES_IGNORED

 new player = STR_T
 if (!player)
 return FMRES_IGNORED
 
 new classname[STR_T]
 pev(world, pev_classname, classname, (STR_T))
 
 if(equal(classname, "worldspawn") || equal(classname, "func_wall") || equal(classname, "func_breakable"))
 pev(id, pev_origin, g_wallorigin[id])

 return FMRES_IGNORED
}

public wallclimb(id, button)
{
 static Float:origin[3]
 pev(id, pev_origin, origin)

 if(get_distance_f(origin, g_wallorigin[id]) > 25.0)
 return FMRES_IGNORED  // if not near wall
 
 if(fm_get_entity_flags(id) & FL_ONGROUND)
 return FMRES_IGNORED
 
 if(button & IN_FORWARD)
 {
 static Float:velocity[3]
 velocity_by_aim(id, 120, velocity)
 fm_set_user_velocity(id, velocity)
 }
 else if(button & IN_BACK)
 {
 static Float:velocity[3]
 velocity_by_aim(id, -120, velocity)
 fm_set_user_velocity(id, velocity)
 }
 return FMRES_IGNORED
}

public fwd_playerprethink(id)
{
 if(!g_WallClimb[id] || !zp_get_user_zombie(id))
 return FMRES_IGNORED
 
 if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0)
 return FMRES_IGNORED
 
 if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
 return FMRES_IGNORED
 
 new button = fm_get_user_button(id)
 
 if((get_pcvar_num(cvar_zp_wallclimb) == 1) && (button & IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb
 wallclimb(id, button)
 else if((get_pcvar_num(cvar_zp_wallclimb) == 2) && (button & IN_JUMP) && button & IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb
 wallclimb(id, button)

 return FMRES_IGNORED
}

descriptionplugin class zm_climb EmptyRe: plugin class zm_climb

more_horiz

Código:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>

//#include <fakemeta_util>
#define STR_T           33

// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button)
/* stock fm_get_user_button(index)
return pev(index, pev_button) */

#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
return pev(index, pev_flags) */

stock fm_set_user_velocity(entity, const Float:vector[3]) {
 set_pev(entity, pev_velocity, vector);
 
 return 1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33], used_skill[33]
new Float:g_wallorigin[32][3]
new cvar_zp_wallclimb, cvar_zp_wallclimb_nemesis, cvar_zp_wallclimb_survivor
new g_zclass_climb

// Climb Zombie Atributes
new const zclass_name[] = { "Climb Zombie" } // name
new const zclass_info[] = { "HP-- Speed+ Jump+ Knockback++" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 1200 // health
const zclass_speed = 220 // speed
const Float:zclass_gravity = 0.8 // gravity
const Float:zclass_knockback = 1.5 // knockback

public plugin_init()
{
 register_plugin("[ZP] Wallclimb ", "1.0", "WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
 register_forward(FM_Touch, "fwd_touch")
 register_forward(FM_PlayerPreThink, "fwd_playerprethink")
 //register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
 register_event("DeathMsg","EventDeathMsg","a")
 //register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
 cvar_zp_wallclimb = register_cvar("zp_wallclimb", "1")
 cvar_zp_wallclimb_survivor = register_cvar("zp_wallclimb_survivor", "0")
 cvar_zp_wallclimb_nemesis = register_cvar("zp_wallclimb_nemesis", "1")
 
}

public plugin_precache()
{
 g_zclass_climb = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public EventDeathMsg()
{
 new id = read_data(2)
 g_WallClimb[id] = false
 return PLUGIN_HANDLED
}

public client_connect(id) {
 g_WallClimb[id] = false
}

public fwd_touch(id, world)
{
 if(!is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
 return FMRES_IGNORED
 
 new player = STR_T
 if (!player)
 return FMRES_IGNORED
 
 new classname[STR_T]
 pev(world, pev_classname, classname, (STR_T))
 
 if(equal(classname, "worldspawn") || equal(classname, "func_wall") || equal(classname, "func_breakable"))
 pev(id, pev_origin, g_wallorigin[id])
 
 return FMRES_IGNORED
}

public wallclimb(id, button)
{
 static Float:origin[3]
 pev(id, pev_origin, origin)
 
 if(get_distance_f(origin, g_wallorigin[id]) > 25.0)
 return FMRES_IGNORED  // if not near wall
 
 if(fm_get_entity_flags(id) & FL_ONGROUND)
 return FMRES_IGNORED
 
 if(button & IN_FORWARD)
 {
 static Float:velocity[3]
 velocity_by_aim(id, 120, velocity)
 fm_set_user_velocity(id, velocity)
 }
 else if(button & IN_BACK)
 {
 static Float:velocity[3]
 velocity_by_aim(id, -120, velocity)
 fm_set_user_velocity(id, velocity)
 }
 return FMRES_IGNORED
}

public fwd_playerprethink(id)
{
 if(!zp_get_user_zombie(id) || used_skill[id])
 return FMRES_IGNORED

 if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0)
 return FMRES_IGNORED
 
 if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
 return FMRES_IGNORED

 if(zp_get_user_zombie_class(id) != g_zclass_climb)
 return FMRES_IGNORED
 

 new button = fm_get_user_button(id)

 if((button & IN_RELOAD) && !used_skill[id])
 {
 used_skill[id] = true
 g_WallClimb[id] = true
 client_print(id, print_chat, "[ZP] Voce Ativou a Habilidade, Pule em uma Parede e Segure [E] para sair escalando")
 remove_task(id)
 set_task(5.0, "stop_skill", id)
 }

 if(!g_WallClimb[id])
 return FMRES_IGNORED
 
 if((get_pcvar_num(cvar_zp_wallclimb) == 1) && (button & IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb
 wallclimb(id, button)
 else if((get_pcvar_num(cvar_zp_wallclimb) == 2) && (button & IN_JUMP) && button & IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb
 wallclimb(id, button)
 
 return FMRES_IGNORED
}
public stop_skill(id)
{
 g_WallClimb[id] = false
 client_print(id, print_chat, "[ZP] Sua Abilidade Acabou Aguarde 5 segundos para usar novamente")
 set_task(5.0, "set_skil", id+1234)
}
public set_skil(id)
{
 id -= 1234
 used_skill[id] = false
 client_print(id, print_chat, "[ZP] Sua Habilidade esta pronta, Pressione [R] para ativar")
}
public zp_user_humanized_post(id)
{
 remove_task(id+1234)
 remove_task(id)
 g_WallClimb[id] = false
}
public zp_user_infected_post(id)
{
 if(zp_get_user_zombie_class(id) != g_zclass_climb || zp_get_user_nemesis(id))
 return;

 remove_task(id+1234)
 remove_task(id)
 used_skill[id] = false
 g_WallClimb[id] = false
 client_print(id, print_chat, "[ZP] Sua Habilidade esta pronta, Pressione [R] para ativar")
}

descriptionplugin class zm_climb EmptyRe: plugin class zm_climb

more_horiz
Brigadão ai [P]erfec[T] [S]cr[@]s[H] pela força.


eu estou ainda com um problema não to conseguindo escalar com ele

para bloquear que o nemesis a use e so deletar a ultima public ou so desativar na cvars?

ele normal do jeito que eu lhe enviei aqui mesmo colocando 0 nas cvars o nemesis conseguia escalar.

descriptionplugin class zm_climb EmptyRe: plugin class zm_climb

more_horiz
Pra travar pra uma determinada classe basta por
if(zp_get_user_nemesis(id))
     return PLUGIN_HANDLED

na no topo da parte que executa o poder do zumbi...

descriptionplugin class zm_climb EmptyRe: plugin class zm_climb

more_horiz
https://www.mediafire.com/file/nsp7ee6tah6d1wp/2.dem

ai a demo de onde eu vi a class de zombie

descriptionplugin class zm_climb EmptyRe: plugin class zm_climb

more_horiz
Como a tua base é ZP 5.0 não sei se o assasino seu tem a native necessaria pra bloquear, portanto só botei pra bloquear a do nemesis.

Código:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>

//#include <fakemeta_util>
#define STR_T          33

// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button)
/* stock fm_get_user_button(index)
return pev(index, pev_button) */

#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
return pev(index, pev_flags) */

stock fm_set_user_velocity(entity, const Float:vector[3]) {
   set_pev(entity, pev_velocity, vector);
   
   return 1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33], used_skill[33]
new Float:g_wallorigin[32][3]
new cvar_zp_wallclimb
new g_zclass_climb

// Climb Zombie Atributes
new const zclass_name[] = { "Climb Zombie" } // name
new const zclass_info[] = { "HP-- Speed+ Jump+ Knockback++" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 1200 // health
const zclass_speed = 220 // speed
const Float:zclass_gravity = 0.8 // gravity
const Float:zclass_knockback = 1.5 // knockback

public plugin_init()
{
   register_plugin("[ZP] Wallclimb ", "1.0", "WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
   register_forward(FM_Touch, "fwd_touch")
   register_forward(FM_PlayerPreThink, "fwd_playerprethink")
   //register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
   register_event("DeathMsg","EventDeathMsg","a")
   //register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
   cvar_zp_wallclimb = register_cvar("zp_wallclimb", "1")
   
}

public plugin_precache()
{
   g_zclass_climb = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public EventDeathMsg()
{
   new id = read_data(2)
   g_WallClimb[id] = false
   return PLUGIN_HANDLED
}

public client_connect(id) {
   g_WallClimb[id] = false
}

public fwd_touch(id, world)
{
   if(!is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
      return FMRES_IGNORED
   
   new player = STR_T
   if (!player)
      return FMRES_IGNORED
   
   new classname[STR_T]
   pev(world, pev_classname, classname, (STR_T))
   
   if(equal(classname, "worldspawn") || equal(classname, "func_wall") || equal(classname, "func_breakable"))
      pev(id, pev_origin, g_wallorigin[id])
   
   return FMRES_IGNORED
}

public wallclimb(id, button)
{
   static Float:origin[3]
   pev(id, pev_origin, origin)
   
   if(get_distance_f(origin, g_wallorigin[id]) > 25.0)
      return FMRES_IGNORED  // if not near wall
   
   if(fm_get_entity_flags(id) & FL_ONGROUND)
      return FMRES_IGNORED
   
   if(button & IN_FORWARD)
   {
      static Float:velocity[3]
      velocity_by_aim(id, 120, velocity)
      fm_set_user_velocity(id, velocity)
   }
   else if(button & IN_BACK)
   {
      static Float:velocity[3]
      velocity_by_aim(id, -120, velocity)
      fm_set_user_velocity(id, velocity)
   }
   return FMRES_IGNORED
}

public fwd_playerprethink(id)
{
   if(!zp_get_user_zombie(id) || used_skill[id])
      return FMRES_IGNORED
   
   if(zp_get_user_nemesis(id))
      return FMRES_IGNORED
   
   if(zp_get_user_zombie_class(id) != g_zclass_climb)
      return FMRES_IGNORED
   
   
   new button = fm_get_user_button(id)
   
   if((button & IN_RELOAD) && !used_skill[id])
   {
      used_skill[id] = true
      g_WallClimb[id] = true
      client_print(id, print_chat, "[ZP] Voce Ativou a Habilidade, Pule em uma Parede e Segure [E] para sair escalando")
      remove_task(id)
      set_task(5.0, "stop_skill", id)
   }
   
   if(!g_WallClimb[id])
      return FMRES_IGNORED
   
   if((get_pcvar_num(cvar_zp_wallclimb) == 1) && (button & IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb
      wallclimb(id, button)
   else if((get_pcvar_num(cvar_zp_wallclimb) == 2) && (button & IN_JUMP) && button & IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb
      wallclimb(id, button)
   
   return FMRES_IGNORED
}
public stop_skill(id)
{
   g_WallClimb[id] = false
   client_print(id, print_chat, "[ZP] Sua Abilidade Acabou Aguarde 5 segundos para usar novamente")
   set_task(5.0, "set_skil", id+1234)
}
public set_skil(id)
{
   id -= 1234
   used_skill[id] = false
   client_print(id, print_chat, "[ZP] Sua Habilidade esta pronta, Pressione [R] para ativar")
}
public zp_user_humanized_post(id)
{
   remove_task(id+1234)
   remove_task(id)
   g_WallClimb[id] = false
}
public zp_user_infected_post(id)
{
   remove_task(id+1234)
   remove_task(id)

   if(zp_get_user_zombie_class(id) != g_zclass_climb || zp_get_user_nemesis(id))
      return;
   
   used_skill[id] = false
   g_WallClimb[id] = false
   client_print(id, print_chat, "[ZP] Sua Habilidade esta pronta, Pressione [R] para ativar")
}

descriptionplugin class zm_climb EmptyRe: plugin class zm_climb

more_horiz
privacy_tip Permissões neste sub-fórum
Não podes responder a tópicos
power_settings_newInicie sessão para responder