Zumbis Online
Últimos assuntos
» [ZP AMXX] CSO Shop Costumes
por Eclipse 13/12/2017, 9:32 pm

» Servidores da P[c]T eGames
por scho 3/12/2017, 4:22 pm

» (Ajuda) ZM VIP com Status do Perfect por Menssagem para Dono tambem!
por scho 26/11/2017, 9:09 am

» Voltei ao fórum
por zgd.dll 25/11/2017, 12:20 am

» plugin gamemode infection
por cancels 21/11/2017, 10:22 pm

» plugin ap force_jump
por cancels 21/11/2017, 9:29 pm

» plugin gamemode sniper
por cancels 21/11/2017, 7:58 pm

» plugin class zm_climb
por [P]erfec[T] [S]cr[@]s[H] 17/11/2017, 5:46 pm

» plugin item t-virus
por [P]erfec[T] [S]cr[@]s[H] 17/11/2017, 5:39 pm

» Hide Sheek Supply Box
por cancels 12/11/2017, 9:00 pm

Frases filosóficas Zplague:
....
Os membros mais ativos da semana
Eclipse
 

Adsense

[HELP] - Zombie Hunter

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

[HELP] - Zombie Hunter

Mensagem por 0wnderless em 9/9/2013, 4:41 am

Bem pessoal vou disponibilizar uma sma do meu zombie hunter, Não consigo fixar o bug de humano/nemesis/sniper/survivor/assasino usar a habilidade do hunter.
Tambem queria saber como faz para adicionar um certo tempo para o hunter pular denovo.
Pois ele esta pulando sem parar. Favor ajudem ^^ Grato !

Spoiler:

Código:
/*================================================================================

-----------------------------------
-*- [ZP] Hunter L4D -*-
-----------------------------------

~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~

This zombie has long jumps as well as the popular game L4D2
Well, this time the skill is good and better,
to jump you have to press Ctrl + E and look where you want to jump.

================================================================================*/

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

/*================================================================================
[Customizations]
=================================================================================*/

// Zombie Attributes
new const zclass_name[] = "Zombie Hunter"
new const zclass_info[] = "\rSuper Pulo CTRL + E "
new const zclass_model[] = "hunterv2_zp"
new const zclass_clawmodel[] = "v_knife_zombie_hunter.mdl"

const zclass_health = 2800
const zclass_speed = 290
const Float:zclass_gravity = 0.9
const Float:zclass_knockback = 1.0

new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }

/*================================================================================
Customization ends here!
Any edits will be your responsibility
=================================================================================*/

// Variables
new g_hunter

// Arrays
new Float:g_lastleaptime[33]

// Cvar pointers
new cvar_force, cvar_cooldown

// Plugin info.
#define PLUG_VERSION "0.2"
#define PLUG_AUTHOR "DJHD!"

/*================================================================================
[Init, CFG and Precache]
=================================================================================*/

public plugin_precache()
{
   // Register the new class and store ID for reference
   g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
   
   // Sound
   static i
   for(i = 0; i < sizeof leap_sound; i++)
      precache_sound(leap_sound[i])
}

public plugin_init()
{
   // Plugin Info
   register_plugin("[ZP] Zombie Class: Hunter L4D2 Zombie", PLUG_VERSION, PLUG_AUTHOR)
   
   // Forward
   register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
   
   // Cvars
   cvar_force = register_cvar("zp_hunter_jump_force", "890")
   cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "1.0")
   
   static szCvar[30]
   formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUG_VERSION, PLUG_AUTHOR)
   register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/*================================================================================
[Zombie Plague Forwards]
=================================================================================*/

public zp_user_infected_post(id, infector)
{
   // It's the selected zombie class
   if(zp_get_user_zombie_class(id) == g_hunter)
   {
      if(zp_get_user_nemesis(id))
         return
      
      // Message
      client_print(id, print_chat, "[ZP] To use the super jump ability press - ^"CTRL + E^"")
   }
}

/*================================================================================
[Main Forwards]
=================================================================================*/

public fw_PlayerPreThink(id)
{
   if(!is_user_alive(id))
      return
      
   if(zp_get_user_nemesis(id))
      return
   
   if(is_user_connected(id))
   {
      if (allowed_hunterjump(id))
      {
         static Float:velocity[3]
         velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
         set_pev(id, pev_velocity, velocity)
         
         emit_sound(id, CHAN_STREAM, leap_sound[random_num(0, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
         
         // Set the current super jump time
         g_lastleaptime[id] = get_gametime()
      }
   }
}

/*================================================================================
[Internal Functions]
=================================================================================*/

allowed_hunterjump(id)
{    
   if (!zp_get_user_zombie(id) && zp_get_user_nemesis(id))
      return false
   
   if (zp_get_user_zombie_class(id) != g_hunter)
      return false
   
   if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
      return false
   
   static buttons
   buttons = pev(id, pev_button)
   
   // Not doing a longjump (added bot support)
   if (!(buttons & IN_USE) && !is_user_bot(id))
      return false
   
   static Float:cooldown
   cooldown = get_pcvar_float(cvar_cooldown)
   
   if (get_gametime() - g_lastleaptime[id] < cooldown)
      return false
   
   return true
}
avatar
0wnderless
Moderador
Moderador

Masculino Número de Mensagens : 579
Love you Rafaella <3
Ammo Packs : 1904
Honra : 20
Data de inscrição : 24/08/2013

Ver perfil do usuário http://zplague.forumclan.com/ josh.griz1

Voltar ao Topo Ir em baixo

Re: [HELP] - Zombie Hunter

Mensagem por Convidad em 9/9/2013, 5:57 am

Editei para você para o hunter dar o super pulo a cada 8 segundos.

Código:
- Description -
~~~~~~~~~~~~~~~

This zombie has long jumps as well as the popular game L4D2
Well, this time the skill is good and better,
to jump you have to press Ctrl + E and look where you want to jump.

================================================================================*/

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

/*================================================================================
[Customizations]
=================================================================================*/

// Zombie Attributes
new const zclass_name[] = "Zombie Hunter"
new const zclass_info[] = "\r[Super Pulo CTRL + E] "
new const zclass_model[] = "hunterv2_zp"
new const zclass_clawmodel[] = "v_knife_zombie_hunter.mdl"

const zclass_health = 2800
const zclass_speed = 290
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0

new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }

/*================================================================================
Customization ends here!
Any edits will be your responsibility
=================================================================================*/

// Variables
new g_hunter

// Arrays
new Float:g_lastleaptime[33]

// Cvar pointers
new cvar_force, cvar_cooldown

// Plugin info.
#define PLUG_VERSION "0.2"
#define PLUG_AUTHOR "DJHD!"

/*================================================================================
[Init, CFG and Precache]
=================================================================================*/

public plugin_precache()
{
  // Register the new class and store ID for reference
  g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
 
  // Sound
  static i
  for(i = 0; i < sizeof leap_sound; i++)
      precache_sound(leap_sound[i])
}

public plugin_init()
{
  // Plugin Info
  register_plugin("[ZP] Zombie Class: Hunter L4D2 Zombie", PLUG_VERSION, PLUG_AUTHOR)
 
  // Forward
  register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
 
  // Cvars
  cvar_force = register_cvar("zp_hunter_jump_force", "890")
  cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "8.0")
 
  static szCvar[30]
  formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUG_VERSION, PLUG_AUTHOR)
  register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/*================================================================================
[Zombie Plague Forwards]
=================================================================================*/

public zp_user_infected_post(id, infector)
{
  // It's the selected zombie class
  if(zp_get_user_zombie_class(id) == g_hunter)
  {
      if(zp_get_user_nemesis(id))
        return
     
      // Message
      client_print(id, print_chat, "[ZP] To use the super jump ability press - ^"CTRL + E^"")
  }
}

/*================================================================================
[Main Forwards]
=================================================================================*/

public fw_PlayerPreThink(id)
{
  if(!is_user_alive(id))
      return
     
  if(zp_get_user_nemesis(id))
      return
 
  if(is_user_connected(id))
  {
      if (allowed_hunterjump(id))
      {
        static Float:velocity[3]
        velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
        set_pev(id, pev_velocity, velocity)
       
        emit_sound(id, CHAN_STREAM, leap_sound[random_num(0, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
       
        // Set the current super jump time
        g_lastleaptime[id] = get_gametime()
      }
  }
}

/*================================================================================
[Internal Functions]
=================================================================================*/

allowed_hunterjump(id)
{   
  if (!zp_get_user_zombie(id) && zp_get_user_nemesis(id))
      return false
 
  if (zp_get_user_zombie_class(id) != g_hunter)
      return false
 
  if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
      return false
 
  static buttons
  buttons = pev(id, pev_button)
 
  // Not doing a longjump (added bot support)
  if (!(buttons & IN_USE) && !is_user_bot(id))
      return false
 
  static Float:cooldown
  cooldown = get_pcvar_float(cvar_cooldown)
 
  if (get_gametime() - g_lastleaptime[id] < cooldown)
      return false
 
  return true
}
Caso queira saber como altera isso procure a seguinte linha:

cvar_force = register_cvar("zp_hunter_jump_force", "890") > gravidade que ele ira pular.
 
e logo abaixo:

cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "8.0")

Poderia ter pedido no skype ;/ mas ta tudo bem.
Se ajudei mereço um rep né!

Convidad
Convidado


Voltar ao Topo Ir em baixo

Re: [HELP] - Zombie Hunter

Mensagem por [P]erfec[T] [S]cr[@]s[H] em 9/9/2013, 12:34 pm

E eu Fixei o Bug e dei Uma Traduzida.

SMA:
Código:
/*================================================================================
- Description -
~~~~~~~~~~~~~~~

This zombie has long jumps as well as the popular game L4D2
Well, this time the skill is good and better,
to jump you have to press Ctrl + E and look where you want to jump.

================================================================================*/

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

/*================================================================================
[Customizations]
=================================================================================*/

// Zombie Attributes
new const zclass_name[] = "Zombie Hunter"
new const zclass_info[] = "\r[Super Pulo CTRL + E] "
new const zclass_model[] = "hunterv2_zp"
new const zclass_clawmodel[] = "v_knife_zombie_hunter.mdl"

const zclass_health = 2800
const zclass_speed = 290
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0

new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }

/*================================================================================
Customization ends here!
Any edits will be your responsibility
=================================================================================*/

// Variables
new g_hunter

// Arrays
new Float:g_lastleaptime[33]

// Cvar pointers
new cvar_force, cvar_cooldown

// Plugin info.
#define PLUG_VERSION "0.2"
#define PLUG_AUTHOR "DJHD!"

/*================================================================================
[Init, CFG and Precache]
=================================================================================*/

public plugin_precache()
{
  // Register the new class and store ID for reference
  g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  
  // Sound
  static i
  for(i = 0; i < sizeof leap_sound; i++)
      precache_sound(leap_sound[i])
}

public plugin_init()
{
  // Plugin Info
  register_plugin("[ZP] Zombie Class: Hunter L4D2 Zombie", PLUG_VERSION, PLUG_AUTHOR)
  
  // Forward
  register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
  
  // Cvars
  cvar_force = register_cvar("zp_hunter_jump_force", "890")
  cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "8.0")
  
  static szCvar[30]
  formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUG_VERSION, PLUG_AUTHOR)
  register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/*================================================================================
[Zombie Plague Forwards]
=================================================================================*/

public zp_user_infected_post(id, infector)
{
  // It's the selected zombie class
  if(zp_get_user_zombie_class(id) == g_hunter)
  {
      if(zp_get_user_nemesis(id))
        return

      if(!zp_get_user_zombie(id))      // Para Nao Bugar A Classe Quando Estiver de Humano
        return
      
      // Message
      client_printcolor(id, "/g[ZP]/y Para Usar o Poder do Super Pulo Pressione /g-/t ^"CTRL + E^"")
  }
}

/*================================================================================
[Main Forwards]
=================================================================================*/

public fw_PlayerPreThink(id)
{
  if(!is_user_alive(id))
      return
      
  if(zp_get_user_nemesis(id))
      return
      
  if(!zp_get_user_zombie(id))      // Para Nao Bugar A Classe Quando Estiver de Humano
      return
  
  if(is_user_connected(id))
  {
      if (allowed_hunterjump(id))
      {
        static Float:velocity[3]
        velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
        set_pev(id, pev_velocity, velocity)
        
        emit_sound(id, CHAN_STREAM, leap_sound[random_num(0, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
        
        // Set the current super jump time
        g_lastleaptime[id] = get_gametime()
      }
  }
}

/*================================================================================
[Internal Functions]
=================================================================================*/

allowed_hunterjump(id)
{    
  if (!zp_get_user_zombie(id) && zp_get_user_nemesis(id))
      return false
  
  if (zp_get_user_zombie_class(id) != g_hunter)
      return false
  
  if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
      return false
  
  static buttons
  buttons = pev(id, pev_button)
  
  // Not doing a longjump (added bot support)
  if (!(buttons & IN_USE) && !is_user_bot(id))
      return false
  
  static Float:cooldown
  cooldown = get_pcvar_float(cvar_cooldown)
  
  if (get_gametime() - g_lastleaptime[id] < cooldown)
      return false
  
  return true
}

// Mensagem colorida (client_printcolor)
stock client_printcolor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "/g", "^4")  // Chat Verde
   replace_all(msg, 190, "/y", "^1")  // Chat Normal
   replace_all(msg, 190, "/t", "^3")  // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
   
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}

____________________________________________


Dicas Para Ser um Bom Scripter:
* Pense no Plugin que ira criar (Seja Inovador)
* Crie um código SMA imaginário na cabeça de como vai ser o plugin
* Passe o Codigo mental para o AMX Studio
* Compile e Teste
* Corrija Todos os Bugs do Plugin (Caso tiver um)
* Poste o Plugin ;)

** Seguindo as Dicas você estara no Padrão [P]erfec[T] [S]cr[@]s[H] **  
Zplague24 Zplague20Zplague12 
avatar
[P]erfec[T] [S]cr[@]s[H]
Scripter
Scripter

Masculino Número de Mensagens : 558
Jogador FODA Perfect Scrash entrou na zplague
Ammo Packs : 2007
Honra : 176
Data de inscrição : 04/04/2013

Ver perfil do usuário http://www.steamcommunity.com/id/perfectscrash perfect.scrash

Voltar ao Topo Ir em baixo

Re: [HELP] - Zombie Hunter

Mensagem por 0wnderless em 9/9/2013, 5:52 pm

Resolvido obrigado (:

____________________________________________

avatar
0wnderless
Moderador
Moderador

Masculino Número de Mensagens : 579
Love you Rafaella <3
Ammo Packs : 1904
Honra : 20
Data de inscrição : 24/08/2013

Ver perfil do usuário http://zplague.forumclan.com/ josh.griz1

Voltar ao Topo Ir em baixo

Re: [HELP] - Zombie Hunter

Mensagem por Leozinho em 9/9/2013, 5:59 pm

Trancado.

____________________________________________

avatar
Leozinho
Administrador
Administrador

Masculino Número de Mensagens : 2856
Ammo Packs : 2876
Honra : 75
Data de inscrição : 20/11/2011

Ver perfil do usuário leozinho.zp

Voltar ao Topo Ir em baixo

Re: [HELP] - Zombie Hunter

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum