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[Duvida] Coloca em fvault Empty[Duvida] Coloca em fvault

more_horiz
Sera se eh possível alguém coloca em fvault pra min?

Código:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include < fun >
#include <hamsandwich>
#include <zombieplague>

native zp_cs_get_user_money(id)
native zp_cs_set_user_money(id,value)

#define PLUGIN "[ZP]Addon: HP&DMG System"
#define VERSION "0.7"
#define AUTHOR "heka"

#define MAX_HEALTH_LEVEL 10
#define MAX_DAMAGE_LEVEL 10

#define HEALTH_LEVEL_COST 3000
#define DAMAGE_LEVEL_COST 3000

new
   g_Levels_Menu,
   buffer[512],
   g_Health_Level[33],
   g_Damage_Level[33]


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR);

   RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage")
   
   register_clcmd("say /levels_menu","Level_Menu");
}

public client_putinserver(iPlayer)
{
   g_Health_Level[iPlayer] = 0
}

public Level_Menu(iPlayer){
   if(g_Health_Level[iPlayer] >= 10 && g_Damage_Level[iPlayer] >= 10){
      formatex(buffer, charsmax(buffer), "Health Level Max^nDamage Level Max");
   }else
   if(g_Health_Level[iPlayer] >= 10 && g_Damage_Level[iPlayer] < 10){
      formatex(buffer, charsmax(buffer), "Health Level Max^nDamage Level %d", g_Damage_Level[iPlayer]);
   }else
   if(g_Health_Level[iPlayer] < 10 && g_Damage_Level[iPlayer] >= 10){
      formatex(buffer, charsmax(buffer), "Health Level %d^nDamage Level Max", g_Health_Level[iPlayer]);
   }else{
      formatex(buffer, charsmax(buffer), "Health Level %d^nDamage Level %d", g_Health_Level[iPlayer], g_Damage_Level[iPlayer]);
   }

   g_Levels_Menu = menu_create(buffer, "Level_Menu_Handler");

   if(!is_user_alive(iPlayer)){
      menu_additem(g_Levels_Menu, "\dUpgrade HP Level\r [Only for Alive Players]", "1");
   }
   else if(g_Health_Level[iPlayer] >= MAX_HEALTH_LEVEL){
      menu_additem(g_Levels_Menu, "\dUpgrade HP Level\r [Max Health Level]", "1");
   }
   else if(zp_cs_get_user_money(iPlayer) < HEALTH_LEVEL_COST){
      menu_additem(g_Levels_Menu, "\dUpgrade Health Level\r [Not enough money]", "2");
   }else{
      menu_additem(g_Levels_Menu, "Upgrade HP Level \r[3000$]", "1");
   }
   if(!is_user_alive(iPlayer)){
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Only for Alive Players]", "2");
   }
   else if(g_Damage_Level[iPlayer] >= MAX_DAMAGE_LEVEL){
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Max Damage Level]", "2");
   }
   else if(zp_cs_get_user_money(iPlayer) < DAMAGE_LEVEL_COST){
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Not enough money]", "2");
   }else{
      menu_additem(g_Levels_Menu, "Upgrade Damage Level \r[3000$]", "2");
   }   
   
   menu_setprop(g_Levels_Menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(iPlayer, g_Levels_Menu, 0);
}

public Level_Menu_Handler(iPlayer, iMenu, iItem){
   if(iItem == MENU_EXIT) menu_destroy(iMenu);

   new data[6], iName[64], access, callback, iKey

   menu_item_getinfo(iMenu, iItem, access, data, 5, iName, 63, callback)

   iKey = str_to_num(data)

   switch(iKey){
      case 1:{
         if(g_Health_Level[iPlayer] >= MAX_HEALTH_LEVEL){
            client_print(iPlayer, print_center, "Max Health Level")

            return PLUGIN_HANDLED;
         }else if(!is_user_alive(iPlayer)){
            client_print(iPlayer, print_center, "Only for Alive Players")

            return PLUGIN_HANDLED;
         }else if(zp_cs_get_user_money(iPlayer) < HEALTH_LEVEL_COST){
            client_print(iPlayer, print_center, "Not enough money")

            return PLUGIN_HANDLED;
         }else{
            if (!zp_get_user_zombie(iPlayer) && !zp_get_user_survivor(iPlayer)) set_user_health(iPlayer, get_user_health(iPlayer) + 20)

            g_Health_Level[iPlayer]++
            client_print(iPlayer, print_center, "Health Level Upgrade to %d", g_Health_Level[iPlayer])

            zp_cs_set_user_money(iPlayer, zp_cs_get_user_money(iPlayer) - HEALTH_LEVEL_COST)
         }
      }
      case 2:{
         if(g_Damage_Level[iPlayer] >= MAX_HEALTH_LEVEL){
            client_print(iPlayer, print_center, "Max Damage Level")

            return PLUGIN_HANDLED;
         }else if(!is_user_alive(iPlayer)){
            client_print(iPlayer, print_center, "Only for Alive Players")

            return PLUGIN_HANDLED;
         }else if(zp_cs_get_user_money(iPlayer) < DAMAGE_LEVEL_COST){
            client_print(iPlayer, print_center, "Not enough money")

            return PLUGIN_HANDLED;
         }else{
            g_Damage_Level[iPlayer]++
            client_print(iPlayer, print_center, "Damage Level Upgrade to %d", g_Damage_Level[iPlayer])

            zp_cs_set_user_money(iPlayer, zp_cs_get_user_money(iPlayer) - DAMAGE_LEVEL_COST)
         }
      }
   }
   return PLUGIN_HANDLED;
}

public CPlayer__TakeDamage(iPlayer, iInflector, iAttacker, Float:iDamage, damagebits)
{
   if (iPlayer == iAttacker) return;
   if (!is_user_connected(iAttacker)) return;
   if (zp_get_user_zombie(iAttacker)) return;
   
   if (!zp_get_user_survivor(iAttacker)) SetHamParamFloat(4, iDamage + g_Damage_Level[iAttacker] * 20.0);
}

public zp_user_humanized_post(iPlayer){
   if (zp_get_user_survivor(iPlayer)) return;

   set_user_health(iPlayer, get_user_health(iPlayer) + g_Health_Level[iPlayer] * 20)
}

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
Quer que salve por nick ?

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
Leozinho escreveu:
Quer que salve por nick ?

se for possível por id

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
id = ?? steam id ?

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
Leozinho escreveu:
id = ?? steam id ?

desculpa kk por ip
hoje eu to doido vei

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
Testa ae 

Código:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <  fun >
#include <hamsandwich>
#include <zombieplague>
#include <fvault>

native zp_cs_get_user_money(id)
native zp_cs_set_user_money(id,value)
   
#define PLUGIN "[ZP]Addon: HP&DMG System"
#define VERSION "0.7"
#define AUTHOR "heka"

#define MAX_HEALTH_LEVEL 10
#define MAX_DAMAGE_LEVEL 10

#define HEALTH_LEVEL_COST 3000
#define DAMAGE_LEVEL_COST 3000

new   g_Levels_Menu,
   buffer[512],
   g_Health_Level[33],
   g_Damage_Level[33];

new    const DBUp[] = "Upgrades"


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR);
   
   RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage")
   
   register_clcmd("say /levels_menu","Level_Menu");
}

public client_putinserver(iPlayer)
{
   Load(iPlayer)
   //g_Health_Level[iPlayer] = 0
}
public Load(id)
{
   new data[50]
   new valor1[45], valor2[45]
   new IP[33]; get_user_ip(id, IP, charsmax(IP), 1)
   
   fvault_get_data(DBUp, IP, data, charsmax(data))
   
   parse(data, valor1, charsmax(valor1), valor2, charsmax(valor2))
   
   g_Health_Level[id] = str_to_num(valor1)
   g_Damage_Level[id] = str_to_num(valor2)
}
public client_disconnect(iPlayer)
{
   Save(iPlayer)
}
public Save(id)
{
   new IP[33]; get_user_ip(id, IP, charsmax(IP), 1)
   new data[50]
   
   formatex(data, charsmax(data), "%d %d", g_Health_Level[id], g_Damage_Level[id])

   fvault_set_data(DBUp, IP, data)
}
public Level_Menu(iPlayer)
{
   if(g_Health_Level[iPlayer] >= 10 && g_Damage_Level[iPlayer] >= 10)
   {
      formatex(buffer, charsmax(buffer), "Health Level Max^nDamage Level Max");
   }
   else if(g_Health_Level[iPlayer] >= 10 && g_Damage_Level[iPlayer] < 10)
   {
      formatex(buffer, charsmax(buffer), "Health Level Max^nDamage Level %d", g_Damage_Level[iPlayer]);
   }
   else if(g_Health_Level[iPlayer] < 10 && g_Damage_Level[iPlayer] >= 10)
   {
      formatex(buffer, charsmax(buffer), "Health Level %d^nDamage Level Max", g_Health_Level[iPlayer]);
   }
   else
   {
      formatex(buffer, charsmax(buffer), "Health Level %d^nDamage Level %d", g_Health_Level[iPlayer], g_Damage_Level[iPlayer]);
   }
   
   g_Levels_Menu = menu_create(buffer, "Level_Menu_Handler");
   
   if(!is_user_alive(iPlayer))
   {
      menu_additem(g_Levels_Menu, "\dUpgrade HP Level\r [Only for Alive Players]", "1");
   }
   else if(g_Health_Level[iPlayer] >= MAX_HEALTH_LEVEL)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade HP Level\r [Max Health Level]", "1");
   }
   else if(zp_cs_get_user_money(iPlayer) < HEALTH_LEVEL_COST)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Health Level\r [Not enough money]", "2");
   }
   else
   {
      menu_additem(g_Levels_Menu, "Upgrade HP Level \r[3000$]", "1");
   }
   if(!is_user_alive(iPlayer))
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Only for Alive Players]", "2");
   }
   else if(g_Damage_Level[iPlayer] >= MAX_DAMAGE_LEVEL)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Max Damage Level]", "2");
   }
   else if(zp_cs_get_user_money(iPlayer) < DAMAGE_LEVEL_COST)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Not enough money]", "2");
   }
   else
   {
      menu_additem(g_Levels_Menu, "Upgrade Damage Level \r[3000$]", "2");
   } 
   
   menu_setprop(g_Levels_Menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(iPlayer, g_Levels_Menu, 0);
}

public Level_Menu_Handler(iPlayer, iMenu, iItem)
{
   if(iItem == MENU_EXIT) menu_destroy(iMenu);
   
   new data[6], iName[64], access, callback, iKey
   
   menu_item_getinfo(iMenu, iItem, access, data, 5, iName, 63, callback)
   
   iKey = str_to_num(data)
   
   switch(iKey)
   {
      case 1:
      {
         if(g_Health_Level[iPlayer] >= MAX_HEALTH_LEVEL)
         {
            client_print(iPlayer, print_center, "Max Health Level")
            
            return PLUGIN_HANDLED;
         }
         else if(!is_user_alive(iPlayer))
         {
            client_print(iPlayer, print_center, "Only for Alive Players")
            
            return PLUGIN_HANDLED;
         }
         else if(zp_cs_get_user_money(iPlayer) < HEALTH_LEVEL_COST)
         {
            client_print(iPlayer, print_center, "Not enough money")
            
            return PLUGIN_HANDLED;
         }
         else
         {
            if (!zp_get_user_zombie(iPlayer) && !zp_get_user_survivor(iPlayer)) set_user_health(iPlayer, get_user_health(iPlayer) + 20)
            
            g_Health_Level[iPlayer]++
            client_print(iPlayer, print_center, "Health Level Upgrade to %d", g_Health_Level[iPlayer])
            
            zp_cs_set_user_money(iPlayer, zp_cs_get_user_money(iPlayer) - HEALTH_LEVEL_COST)
         }
      }
      case 2:
      {
         if(g_Damage_Level[iPlayer] >= MAX_HEALTH_LEVEL)
         {
            client_print(iPlayer, print_center, "Max Damage Level")
            
            return PLUGIN_HANDLED;
         }
         else if(!is_user_alive(iPlayer))
         {
            client_print(iPlayer, print_center, "Only for Alive Players")
            
            return PLUGIN_HANDLED;
         }
         else if(zp_cs_get_user_money(iPlayer) < DAMAGE_LEVEL_COST)
         {
            client_print(iPlayer, print_center, "Not enough money")
            
            return PLUGIN_HANDLED;
         }
         else
         {
            g_Damage_Level[iPlayer]++
            client_print(iPlayer, print_center, "Damage Level Upgrade to %d", g_Damage_Level[iPlayer])
            
            zp_cs_set_user_money(iPlayer, zp_cs_get_user_money(iPlayer) - DAMAGE_LEVEL_COST)
         }
      }
   }
   return PLUGIN_HANDLED;
}

public CPlayer__TakeDamage(iPlayer, iInflector, iAttacker, Float:iDamage, damagebits)
{
   if (iPlayer == iAttacker) return;
   if (!is_user_connected(iAttacker)) return;
   if (zp_get_user_zombie(iAttacker)) return;
   
   if (!zp_get_user_survivor(iAttacker)) SetHamParamFloat(4, iDamage + g_Damage_Level[iAttacker] * 20.0);
}

public zp_user_humanized_post(iPlayer)
{
   if (zp_get_user_survivor(iPlayer)) return;
   
   set_user_health(iPlayer, get_user_health(iPlayer) + g_Health_Level[iPlayer] * 20)
}

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
não funfo, tipo eu compro hp ai ele salva só naquele round, mas já no próximo round ele não salva, tente muda pra salva por nick.

Vo manda sma no privado
pq deis uns edit nela

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
quem quiser por NICK


Código:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <   fun >
#include <hamsandwich>
#include <zombieplague>
#include <fvault>

native zp_cs_get_user_money(id)
   native zp_cs_set_user_money(id,value)
   
#define PLUGIN "[ZP]Addon: HP&DMG System"
#define VERSION "0.7"
#define AUTHOR "heka"

#define MAX_HEALTH_LEVEL 10
#define MAX_DAMAGE_LEVEL 10

#define HEALTH_LEVEL_COST 3000
#define DAMAGE_LEVEL_COST 3000

new   g_Levels_Menu,
buffer[512],
g_Health_Level[33],
g_Damage_Level[33];

new    const DBUp[] = "Upgrades"


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR);
   
   RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage")
   
   register_clcmd("say /levels_menu","Level_Menu");
}

public client_putinserver(iPlayer)
{
   Load(iPlayer)
   //g_Health_Level[iPlayer] = 0
}
public Load(id)
{
   new data[50]
   new valor1[45], valor2[45]
   new name[32]; get_user_name(id, name, 31)
   
   fvault_get_data(DBUp, name, data, charsmax(data))
   
   parse(data, valor1, charsmax(valor1), valor2, charsmax(valor2))
   
   g_Health_Level[id] = str_to_num(valor1)
   g_Damage_Level[id] = str_to_num(valor2)
}
public client_disconnect(iPlayer)
{
   Save(iPlayer)
}
public Save(id)
{
   new name[32]; get_user_name(id, name, 31)
   new data[50]
   
   formatex(data, charsmax(data), "%d %d", g_Health_Level[id], g_Damage_Level[id])
   
   fvault_set_data(DBUp, name, data)
}
public Level_Menu(iPlayer)
{
   if(g_Health_Level[iPlayer] >= 10 && g_Damage_Level[iPlayer] >= 10)
   {
      formatex(buffer, charsmax(buffer), "Health Level Max^nDamage Level Max");
   }
   else if(g_Health_Level[iPlayer] >= 10 && g_Damage_Level[iPlayer] < 10)
   {
      formatex(buffer, charsmax(buffer), "Health Level Max^nDamage Level %d", g_Damage_Level[iPlayer]);
   }
   else if(g_Health_Level[iPlayer] < 10 && g_Damage_Level[iPlayer] >= 10)
   {
      formatex(buffer, charsmax(buffer), "Health Level %d^nDamage Level Max", g_Health_Level[iPlayer]);
   }
   else
   {
      formatex(buffer, charsmax(buffer), "Health Level %d^nDamage Level %d", g_Health_Level[iPlayer], g_Damage_Level[iPlayer]);
   }
   
   g_Levels_Menu = menu_create(buffer, "Level_Menu_Handler");
   
   if(!is_user_alive(iPlayer))
   {
      menu_additem(g_Levels_Menu, "\dUpgrade HP Level\r [Only for Alive Players]", "1");
   }
   else if(g_Health_Level[iPlayer] >= MAX_HEALTH_LEVEL)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade HP Level\r [Max Health Level]", "1");
   }
   else if(zp_cs_get_user_money(iPlayer) < HEALTH_LEVEL_COST)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Health Level\r [Not enough money]", "2");
   }
   else
   {
      menu_additem(g_Levels_Menu, "Upgrade HP Level \r[3000$]", "1");
   }
   if(!is_user_alive(iPlayer))
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Only for Alive Players]", "2");
   }
   else if(g_Damage_Level[iPlayer] >= MAX_DAMAGE_LEVEL)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Max Damage Level]", "2");
   }
   else if(zp_cs_get_user_money(iPlayer) < DAMAGE_LEVEL_COST)
   {
      menu_additem(g_Levels_Menu, "\dUpgrade Damage Level\r [Not enough money]", "2");
   }
   else
   {
      menu_additem(g_Levels_Menu, "Upgrade Damage Level \r[3000$]", "2");
   }  
   
   menu_setprop(g_Levels_Menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(iPlayer, g_Levels_Menu, 0);
}

public Level_Menu_Handler(iPlayer, iMenu, iItem)
{
   if(iItem == MENU_EXIT) menu_destroy(iMenu);
   
   new data[6], iName[64], access, callback, iKey
   
   menu_item_getinfo(iMenu, iItem, access, data, 5, iName, 63, callback)
   
   iKey = str_to_num(data)
   
   switch(iKey)
   {
      case 1:
      {
         if(g_Health_Level[iPlayer] >= MAX_HEALTH_LEVEL)
         {
            client_print(iPlayer, print_center, "Max Health Level")
            
            return PLUGIN_HANDLED;
         }
         else if(!is_user_alive(iPlayer))
         {
            client_print(iPlayer, print_center, "Only for Alive Players")
            
            return PLUGIN_HANDLED;
         }
         else if(zp_cs_get_user_money(iPlayer) < HEALTH_LEVEL_COST)
         {
            client_print(iPlayer, print_center, "Not enough money")
            
            return PLUGIN_HANDLED;
         }
         else
         {
            if (!zp_get_user_zombie(iPlayer) && !zp_get_user_survivor(iPlayer)) set_user_health(iPlayer, get_user_health(iPlayer) + 20)
            
            g_Health_Level[iPlayer]++
            client_print(iPlayer, print_center, "Health Level Upgrade to %d", g_Health_Level[iPlayer])
            
            zp_cs_set_user_money(iPlayer, zp_cs_get_user_money(iPlayer) - HEALTH_LEVEL_COST)
         }
      }
      case 2:
      {
         if(g_Damage_Level[iPlayer] >= MAX_HEALTH_LEVEL)
         {
            client_print(iPlayer, print_center, "Max Damage Level")
            
            return PLUGIN_HANDLED;
         }
         else if(!is_user_alive(iPlayer))
         {
            client_print(iPlayer, print_center, "Only for Alive Players")
            
            return PLUGIN_HANDLED;
         }
         else if(zp_cs_get_user_money(iPlayer) < DAMAGE_LEVEL_COST)
         {
            client_print(iPlayer, print_center, "Not enough money")
            
            return PLUGIN_HANDLED;
         }
         else
         {
            g_Damage_Level[iPlayer]++
            client_print(iPlayer, print_center, "Damage Level Upgrade to %d", g_Damage_Level[iPlayer])
            
            zp_cs_set_user_money(iPlayer, zp_cs_get_user_money(iPlayer) - DAMAGE_LEVEL_COST)
         }
      }
   }
   return PLUGIN_HANDLED;
}

public CPlayer__TakeDamage(iPlayer, iInflector, iAttacker, Float:iDamage, damagebits)
{
   if (iPlayer == iAttacker) return;
   if (!is_user_connected(iAttacker)) return;
   if (zp_get_user_zombie(iAttacker)) return;
   
   if (!zp_get_user_survivor(iAttacker)) SetHamParamFloat(4, iDamage + g_Damage_Level[iAttacker] * 20.0);
}

public zp_user_humanized_post(iPlayer)
{
   if (zp_get_user_survivor(iPlayer)) return;
   
   set_user_health(iPlayer, get_user_health(iPlayer) + g_Health_Level[iPlayer] * 20)
}

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
@Closed
pode fecha já ta resolvido

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

more_horiz
Closed.

description[Duvida] Coloca em fvault EmptyRe: [Duvida] Coloca em fvault

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