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


description[ZP] Addon: Incentivo a Objetivo Empty[ZP] Addon: Incentivo a Objetivo

more_horiz
Bom em varios servers de zombie plague os jogadores só querem saber de apelar e de ganhar packs e os zombies muitas vezes away e sem objetivo e eu fiz um plugin pra tentar incentivar os zombies a fazerem objetivo.

SMA:

Código:

#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Addon: Incentivo a Objetivo"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"

new allow_incentivo, g_infects_count[33], cvar_infects_for_rwd

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_event("DeathMsg", "DeathEvent", "a");
   
   cvar_infects_for_rwd = register_cvar("zp_infects_for_rwd", "5")
}

public client_putinserver(id) g_infects_count[id] = 0

public client_disconnect(id) g_infects_count[id] = 0

public zp_user_humanized_post(id) g_infects_count[id] = 0

public event_round_start() for(new id = 1; id <= get_maxplayers(); id++) g_infects_count[id] = 0

public zp_round_started(gm)
{
   if(gm == MODE_INFECTION || gm == MODE_MULTI) allow_incentivo = true
   else allow_incentivo = false
}

public zp_user_infected_post(id, infector)
{
   if(!allow_incentivo) return PLUGIN_HANDLED
   
   if((1 <= infector <= get_maxplayers()))
   {
      if(id != infector)
      {
         if(g_infects_count[infector] == get_pcvar_num(cvar_infects_for_rwd))
         {
            zp_disinfect_user(infector)
            client_printcolor(infector, "!g[ZP]!t Voce Ganhou Antidoto Por Infectar !g%d!t Humanos", get_pcvar_num(cvar_infects_for_rwd))
            g_infects_count[infector] = 0
            return PLUGIN_HANDLED
         }
         else
         {
            g_infects_count[infector]++
            client_printcolor(infector, "!g[ZP]!t Infecte Mais !g%d!t Humanos Para Ganhar Antidoto", get_pcvar_num(cvar_infects_for_rwd) - g_infects_count[infector])
            return PLUGIN_HANDLED
         }
      }
   }
   return PLUGIN_CONTINUE
}

// Compatibilidade com a classe de zm swarm e alguns outros
public DeathEvent()
{
   new id = read_data(1)
   
   if(!allow_incentivo || !zp_get_user_zombie(id)) return PLUGIN_HANDLED
   
   if(g_infects_count[id] == get_pcvar_num(cvar_infects_for_rwd))
   {
      zp_disinfect_user(id)
      client_printcolor(id, "!g[ZP]!t Voce Ganhou Antidoto Por Infectar !g%d!t Humanos", get_pcvar_num(cvar_infects_for_rwd))
      g_infects_count[id] = 0
      return PLUGIN_HANDLED
   }
   else
   {
      g_infects_count[id]++
      client_printcolor(id, "!g[ZP]!t Infecte Mais !g%d!t Humanos Para Ganhar Antidoto", get_pcvar_num(cvar_infects_for_rwd) - g_infects_count[id])
      return PLUGIN_HANDLED
   }
   return PLUGIN_CONTINUE
}

stock client_printcolor(const id,const input[], any:...)
{
   new msg[191], players[32], count = 1; vformat(msg,190,input,3);
   replace_all(msg,190,"!g","^4");    // green
   replace_all(msg,190,"!y","^1");    // normal
   replace_all(msg,190,"!t","^3");    // team
   
   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();
      }
   }
}


Última edição por [P]erfec[T] [S]cr[@]s[H] em 15/5/2014, 2:24 pm, editado 3 vez(es) (Motivo da edição : Atualização do plugin)

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Boa perfect, mais um plugin bem pensado !

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
mt legal cara !!

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Interessante perfect, nice job !

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
perfect :) '

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Muito bom mesmo Zplague12

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Oq ele faz?

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Ganha um ANTIDOTO por infectar humanos.

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Zplague12

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Plugin Atualizado: Feito no dia 15/05/2014 as 14:49:11

* Fixado o Bug da mensagem aparecer pra todos e mais alguns bugs

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

more_horiz
Muito bom.

description[ZP] Addon: Incentivo a Objetivo EmptyRe: [ZP] Addon: Incentivo a Objetivo

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