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[ZPS] Comprar MODs *VIP* Empty[ZPS] Comprar MODs *VIP*

more_horiz
Nome do Plugin : Comprar mods VIP ZPS
Descrição do Plugin : Voce quando e Vip pode comprar mods ( obs : todas as mensagens do chat estão em ingles )
Creditos :  Aaarnas, Perfect e Soukito
Plugin : 

Código:

#include <amxmodx>
#include <zombie_plague_special>
#include <zmvip>

#define PLUGIN "[ZP] Compra de Mods"
#define VERSION "1.1"
#define AUTHOR "aaarnas"

new g_msgSayText
new nemesis, survivor, assassin, sniper, berserker, predator, bombardier, dragon, wesker, spy
new g_bought[33], bought
new cvar_nemesis_price, cvar_survivor_price, cvar_assassin_price, cvar_sniper_price, cvar_berserker_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times
new cvar_predator_price, cvar_bombardier_price, cvar_dragon_price, cvar_wesker_price, cvar_spy_price
public plugin_init() {
  register_plugin(PLUGIN, VERSION, AUTHOR)
  cvar_everytime = register_cvar("zp_allow_buy", "0")      // 0 - Comprar antes da infeccao, 1 - Comprar depois da infeccao, 2 - Comprar em nemhuma ocasiao
  cvar_allow_times = register_cvar("zp_allow_times", "3")  // Limite de compras por mapa
  cvar_limit_all = register_cvar("zp_limit_for_all", "1")  // Eu acho que eh quantos players pode comprar por round
  cvar_nemesis_price = register_cvar("zp_nemesis_price", "50")          // Preco do nemesis
  cvar_survivor_price = register_cvar("zp_survivor_price", "60")       // Preco do survivor
  cvar_assassin_price = register_cvar("zp_assassin_price", "50")      // Preco do assassino
  cvar_sniper_price = register_cvar("zp_sniper_price", "40")         // Preco do sniper
  cvar_berserker_price = register_cvar("zp_berserker_price", "40")  // Preco do berserker
  cvar_predator_price = register_cvar("zp_predator_price", "50")
  cvar_bombardier_price = register_cvar("zp_bombardier_price", "50")
  cvar_dragon_price = register_cvar("zp_dragon_price", "50")
  cvar_wesker_price = register_cvar("zp_wesker_price", "60")
  cvar_spy_price = register_cvar("zp_spy_price", "60")
  cvar_show_bought = register_cvar("zp_show_who_bought", "1")  // Mostrar quem comprou o que (0 - Desligado, 1 - Ligado)
  
  g_msgSayText = get_user_msgid("SayText")
  
  // Extra items
  nemesis = zv_register_extra_item("Mod Nemesis", "1 Round", get_pcvar_num(cvar_nemesis_price), 0)
  survivor = zv_register_extra_item("Mod Survivor","1 Round", get_pcvar_num(cvar_survivor_price), 0)
  assassin = zv_register_extra_item("Mod Assassin", "1 Round", get_pcvar_num(cvar_assassin_price), 0)
  sniper = zv_register_extra_item("Mod Sniper","1 Round", get_pcvar_num(cvar_sniper_price), 0)
  berserker = zv_register_extra_item("Mod Berserker","1 Round", get_pcvar_num(cvar_berserker_price), 0)
  predator = zv_register_extra_item("Mod Predator","1 Round", get_pcvar_num(cvar_predator_price), 0)
  bombardier = zv_register_extra_item("Mod Bombardier","1 Round", get_pcvar_num(cvar_bombardier_price), 0)
  dragon = zv_register_extra_item("Mod Dragon","1 Round", get_pcvar_num(cvar_dragon_price), 0)
  wesker = zv_register_extra_item("Mod Wesker","1 Round", get_pcvar_num(cvar_wesker_price), 0)
  spy = zv_register_extra_item("Mod Spy","1 Round", get_pcvar_num(cvar_spy_price), 0)
}

public zp_round_ended()
  bought = false

public zv_extra_item_selected(id, itemid) {
  
  new value = get_pcvar_num(cvar_everytime)
  
  if(itemid == nemesis) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next..")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_nemesis(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Nemesis", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_nemesis(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Nemesis", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Nemesis %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == survivor) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next.")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_survivor(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP] /yThe player /g%s/y Bought Survivor", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_survivor(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Survivor", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Survivor %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == assassin) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next.")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_assassin(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Assassin", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_assassin(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Assassin", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Assassin %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == sniper) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next.")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_sniper(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Sniper", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_sniper(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Sniper", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Sniper %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == berserker) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next.")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_berserker(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Berserker", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_berserker(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP] /yThe player /g%s/y Bought Berserker", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Berserker %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == predator) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next..")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_predator(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Predator", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_predator(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Predator", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Predator %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == bombardier) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next..")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_bombardier(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Bombardier", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_bombardier(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Bombardier", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Bombardier %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == dragon) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next..")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_dragon(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Dragon", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_dragon(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Dragon", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Dragon %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == wesker) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next..")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_wesker(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Wesker", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_wesker(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Wesker", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Wesker %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  else if(itemid == spy) {
      
      if(get_pcvar_num(cvar_limit_all) && bought) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else in this round. Try next..")
        return ZV_PLUGIN_HANDLED
      }
      if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
        client_printcolor(id, "/g[ZP]/y You can not buy anything else because you already bought %d mods. Now on the prox map.", get_pcvar_num(cvar_allow_times))
        return ZV_PLUGIN_HANDLED
      }
      if(value == 2) {
        zp_make_user_spy(id)
        new name[64]
        get_user_name(id, name, 63)
        client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Spy", name)
        g_bought[id]++
      }
      else if(zp_has_round_started() == value) {
        zp_make_user_spy(id)
        if(get_pcvar_num(cvar_show_bought)) {
            new name[64]
            get_user_name(id, name, 63)
            client_printcolor(0, "/g[ZP]/y The player /g%s/y Bought Spy", name)
            g_bought[id]++
            bought = true
        }
      }
      else {
        client_printcolor(id, "/g[ZP]/y You can only buy Spy %s.", value ? "After Infection":"Before infection")
        return ZV_PLUGIN_HANDLED
      }
  }
  return 1
}

stock client_printcolor(const id, const input[], any:...)
{
  new iCount = 1, iPlayers[32]
  
  static szMsg[191]
  vformat(szMsg, charsmax(szMsg), input, 3)
  
  replace_all(szMsg, 190, "/g", "^4") // green txt
  replace_all(szMsg, 190, "/y", "^1") // orange txt
  replace_all(szMsg, 190, "/ctr", "^3") // team txt
  replace_all(szMsg, 190, "/w", "^0") // team txt
  
  if(id) iPlayers[0] = id
  else get_players(iPlayers, iCount, "ch")
      
  for (new i = 0; i < iCount; i++)
  {
      if (is_user_connected(iPlayers[i]))
      {
        message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
        write_byte(iPlayers[i])
        write_string(szMsg)
        message_end()
      }
  }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/


Obs : Sofri porque n manjo de amxx mas dei meu jeito e deu certo.

description[ZPS] Comprar MODs *VIP* EmptyRe: [ZPS] Comprar MODs *VIP*

more_horiz
Show :D parabéns

description[ZPS] Comprar MODs *VIP* EmptyRe: [ZPS] Comprar MODs *VIP*

more_horiz
BOA GAROTO CONTINUA PESQUISANDO SOBRE

QUE LOGO LOGO VC APRENDE A EDITAR.

RECOMENDO OLHAR AS INCLUDES DO AMXMODX PARA MELHOR ENTENDER A LINGUAGEM PAWN

description[ZPS] Comprar MODs *VIP* EmptyRe: [ZPS] Comprar MODs *VIP*

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