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 item t-virus Emptyplugin item t-virus

more_horiz
estou com um problema com um plugin t-virus ele está livre para usar em qualquer modo.

queria ver se alguém pode limitar ele pra mim para o uso somente em modo múltipla infecção e infecção modo.

tenho ja 2 plugin;

o que atualmente estou usando:

Código:

#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: T-Virus"
#define VERSION "1.0"
#define AUTHOR "fezh"

new g_virus, name[32]

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   g_virus = zp_register_extra_item("T-Virus", 30, ZP_TEAM_HUMAN)
}

public zp_extra_item_selected(id, itemid)
{
   if (itemid == g_virus)
   {
      get_user_name(id, name, 31)
      set_hudmessage(0, 255, 0, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
      show_hudmessage(0, "%s has infected himself with the T-Virus!", name)
      set_task(5.0, "set_zombie", id)
   }
}

public set_zombie(id)
{
   get_user_name(id, name, 31)
   server_cmd("amx_show_activity 0")
   server_cmd("zp_zombie %s", name)
   server_cmd("amx_show_activity 2")
}




e esse esta com um erro na #include

Código:

#include <amxmodx>
#include <zombieplague>


// Item IDs
new g_t_nemesis, g_t_swarm, g_t_plague, g_t_assassin, g_t_before, g_t_sound
new g_virus
// T-Virus Cost : if you want to change the price of the T-Virus please edit here and edit in the zpa_extraitems.ini also .
new const item_cost = 30
// T-Virus Name
new const item_name[] = "T-Virus"
// players name
new name[32]
// T-Virus Sound : if you want to change the T-Virus Sound just edit here .
new const g_play_sounds[][] =
{
    "zombie_plague/T-Virus.wav" ,
    "zombie_plague/T-Virus2.wav"
}

public plugin_precache   ( )
{
new i
for (i = 0; i < sizeof g_play_sounds; i++)
        precache_sound( g_play_sounds[i] )
}

public plugin_init()
{
   register_plugin("[ZP] Extra Item : T-Virus", "1.0", "A.Madjid")
   
   // Register the new items and store their IDs for future reference
   g_virus = zp_register_extra_item(item_name, item_cost, ZP_TEAM_HUMAN) // Humans only   
   g_t_nemesis = register_cvar("T-Nemesis", "0") // enable or desable T-Virus in nemesis mode .
   g_t_swarm = register_cvar("T-Swarm", "0") // in sawrm mode .
   g_t_plague = register_cvar("T-plague", "0") // in plague mode .
   g_t_assassin = register_cvar("T-Assassin", "0") // in assassin mode .
   g_t_before = register_cvar("T-Allow_Virus_Before_Infection_Spread", "0") // Allow T-Virus before infection starts .
   g_t_sound = register_cvar("T-Sound", "1" ) // T-Virus sound .
   
   
}

// Item Selected forward
public zp_extra_item_selected(player, itemid)
{
   //some vars
   new count_human = zp_get_human_count()
   new count_zombie = zp_get_zombie_count() 
   new mode = zp_get_current_mode()
   new ammo = zp_get_user_ammo_packs(player)
   get_user_name(player, name, 31)
   
   // Check if the selected item matches any of our registered ones
   if ( (itemid == g_virus) )
       {
          if ( (count_human > 1) && (count_zombie > 0) )
         {
            if (mode == MODE_NEMESIS ) 
            {
            if ( get_pcvar_num(g_t_nemesis ) == 1 )
            {
               if (get_pcvar_num(g_t_sound) == 1 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
               }
               else if (get_pcvar_num(g_t_sound) == 0 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               }
            }
            else  if ( get_pcvar_num(g_t_nemesis ) == 0 )
            {
            zp_set_user_ammo_packs(player,ammo + item_cost)
            client_print(player, print_chat, "[P3X] T-Virus is disabled in this mode")
            }
            return;
            }
            if (mode == MODE_SWARM )
            {
            if (get_pcvar_num(g_t_swarm) == 1 )
            {
            if (get_pcvar_num(g_t_sound) == 1 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
               }
               else if (get_pcvar_num(g_t_sound) == 0 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               }
            }
            else  if (get_pcvar_num(g_t_swarm) == 0 )
            {
            zp_set_user_ammo_packs(player,ammo + item_cost)
            client_print(player, print_chat, "[P3X] T-Virus is disabled in this mode")
            }
            return;
            }    
            if (mode == MODE_PLAGUE )
            {
            if (get_pcvar_num(g_t_plague) == 1)
            {
            if (get_pcvar_num(g_t_sound) == 1 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
               }
               else if (get_pcvar_num(g_t_sound) == 0 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               }
            }
            else  if (get_pcvar_num(g_t_plague) == 0)
            {
            zp_set_user_ammo_packs(player,ammo + item_cost)
            client_print(player, print_chat, "[P3X] T-Virus is disabled in this mode")
            }
            return;
            }
            if (mode == MODE_ASSASSIN)
            {
            if (get_pcvar_num(g_t_assassin) == 1)
            {
            if (get_pcvar_num(g_t_sound) == 1 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
               }
               else if (get_pcvar_num(g_t_sound) == 0 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               }
            }
            else  if (get_pcvar_num(g_t_assassin) == 0)
            {
            zp_set_user_ammo_packs(player, ammo + item_cost)
            client_print(player, print_chat, "[P3X] T-Virus is disabled in this mode")
            }
            return;
            }
            else
            {
            if (get_pcvar_num(g_t_sound) == 1 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
               }
               else if (get_pcvar_num(g_t_sound) == 0 )
               {
               set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
               show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
               client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
               zp_infect_user (player, 0, 1, 0)
               }
            }    
         }
         else if ( count_human == 1 )
            {
            zp_set_user_ammo_packs(player, ammo + item_cost)
            client_print(player, print_chat, "[P3X] You can't buy the T-Virus becuse you are the last human")
            }
         else if ( (!count_zombie ) && (get_pcvar_num(g_t_before) == 1) )
               {
                  if (get_pcvar_num(g_t_sound) == 1 )
                  {
                  set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
                  show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
                  client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
                  zp_infect_user (player, 0, 1, 0)
                  client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
                  }
                  else if (get_pcvar_num(g_t_sound) == 0 )
                  {
                  set_hudmessage(0, 200, 0, -0.95, 0.5, 1, 0.0, 10.0, 1.0, 1.0, -1)
                  show_hudmessage(0, "%s Has Bought T-Virus !!!", name)
                  client_print(player, print_chat, "[P3X] You have purchased the T-Virus!")
                  zp_infect_user (player, 0, 1, 0)
                  }
               }
         else if ( (!count_zombie ) && (get_pcvar_num(g_t_before) == 0) )    
            {
            zp_set_user_ammo_packs(player, ammo + item_cost)
            client_print(player, print_chat, "[P3X] You can't buy the T-Virus before any GameMode start")
            }
         }
   }

descriptionplugin item t-virus EmptyRe: plugin item t-virus

more_horiz
qual é a base que você esta usando no seu zp? e a 4.3, ZPA ou a ZPA modificada com mais mods?

descriptionplugin item t-virus EmptyRe: plugin item t-virus

more_horiz
base 5.0

descriptionplugin item t-virus EmptyRe: plugin item t-virus

more_horiz

Código:

#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: T-Virus"
#define VERSION "1.0"
#define AUTHOR "fezh"

new g_virus, name[32], allow

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_event("ResetHUD", "FixBug", "b");
   register_event("DeathMsg", "FixBug", "a")
   g_virus = zp_register_extra_item("T-Virus", 30, ZP_TEAM_HUMAN)
}
public zp_round_started(gm)
{
   if(gm == MODE_INFECTION || gm == MODE_MULTI)
      allow = true
   else
      allow = false
}
public FixBug(id)
   remove_task(id)

public client_disconnect(id)
   remove_task(id)

public zp_user_infected_post(id)
   remove_task(id)

public zp_extra_item_selected(id, itemid)
{
   if (itemid == g_virus)
   {
      if(!zp_has_round_started())
      {
         client_print(id, print_chat, "[ZP] Voce so pode comprar esse item depois do round comecar")
         return ZP_PLUGIN_HANDLED
      }
      if(!allow)
      {
         client_print(id, print_chat, "[ZP] Voce nao pode comprar o item neste modo")
         return ZP_PLUGIN_HANDLED
      }
      get_user_name(id, name, 31)
      set_hudmessage(0, 255, 0, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
      show_hudmessage(0, "O Jogador %s se infectou com o T-Virus!", name)
      set_task(5.0, "set_zombie", id)
   }
   return PLUGIN_CONTINUE
}

public set_zombie(id)
{
   if(!is_user_alive(id))
      return
   if(zp_get_user_zombie(id))
      return;
   
   zp_infect_user(id)
}

descriptionplugin item t-virus EmptyRe: plugin item t-virus

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