Raised This Month: $51 Target: $400
 12% 

[ZP] Crear Niveles por AmmoPacks


  
 
 
Thread Tools Display Modes
Shion
Senior Member
Join Date: Dec 2008
Old 08-16-2011 , 19:20   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#151

uhhm. yo lo use cn Go to :S
__________________
Shion is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 08-17-2011 , 01:09   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#152

un task o.O.

PHP Code:
public update_ap(idamount// adios check
{
         if(
g_ammopacks[id] + amount NIVELES[sizeof NIVELES 1] - 1)
                  return
        
         
g_ammopacks[id] += amount

         
if(g_ammopacks[id] < NIVELES[g_level[id]])
         {
                  do {
                           
g_level[id]--
                  } while(
g_ammopacks[id] < NIVELES[g_level[id]])

                  
client_print(idprint_center"Bajaste de nivel")
         }
         else if(
g_ammopacks[id] >= NIVELES[g_level[id]])
         {
                  do {
                           
g_level[id]++
                  } while(
g_ammopacks[id] >= NIVELES[g_level[id]])
        
                  
client_print(idprint_center"Subiste de nivel")
         }

__________________
Destro- is offline
p4rp4d30
Veteran Member
Join Date: Mar 2007
Old 08-17-2011 , 11:56   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#153

Quote:
Originally Posted by Destro- View Post
un task o.O.

PHP Code:
public update_ap(idamount// adios check
{
         if(
g_ammopacks[id] + amount NIVELES[sizeof NIVELES 1] - 1)
                  return
        
         
g_ammopacks[id] += amount

         
if(g_ammopacks[id] < NIVELES[g_level[id]])
         {
                  do {
                           
g_level[id]--
                  } while(
g_ammopacks[id] < NIVELES[g_level[id]])

                  
client_print(idprint_center"Bajaste de nivel")
         }
         else if(
g_ammopacks[id] >= NIVELES[g_level[id]])
         {
                  do {
                           
g_level[id]++
                  } while(
g_ammopacks[id] >= NIVELES[g_level[id]])
        
                  
client_print(idprint_center"Subiste de nivel")
         }

si lo tenia hace 2 años asi... es mas cuando lo hice nunca mas lo toque yo no hice nada al respecto con ZP xD solo hice 1 copy & paste de lo que tenia en su tiempo por eso dije prueven si les va les va y sino tengo otra manera de armarlo

salu2
p4rp4d30 is offline
Shion
Senior Member
Join Date: Dec 2008
Old 08-20-2011 , 14:27   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#154

hmm alguno que me pase bien el code con o sin go to D: ? Ya me da lo mismo mientras ande.

El Go To cuando gastas aps te baja 1 nivel, el sin go to no sube de nivel, y el de arriba no me compila
__________________

Last edited by Shion; 08-20-2011 at 14:47.
Shion is offline
GokuX
BANNED
Join Date: Jun 2011
Location: Quilpué , Chile
Old 08-25-2011 , 19:50   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#155

pero si es obio que te bajara de level, si es por ammo packs no exp mientras mas ammo packs mas levels mientras menos ammo packs menos level es lógico como no entiendes eso.
GokuX is offline
choferes
Member
Join Date: Aug 2010
Location: Abajo Del Puente
Old 09-28-2011 , 13:08   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#156

Como se hace para que te guarde el level con el "Guardado de datos por cuentas" de kiske??
choferes is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 09-28-2011 , 14:53   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#157

Siguiendo los 2 tutoriales.
Recomiendo aplicar el de guardar cuentas y luego este tutorial.
XINLEI is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 10-24-2011 , 19:18   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#158

perdón por revivir pero tenia una duda y quería saber si se podía solucionar..

en la parte de buy_extra_item, tengo un problema. Se que este Tutorial fue echo para ZP 4.2, yo estoy usando ZP 4.3 y con el tutorial pude hacer los levels, pero cuando compro un item extra no me saca el level. En el tutorial dice que cambiar en esa parte pero si lo cambio me tira error y si no lo cambio, me compra el item extra, me saca los AP pero no me quita el level, así que quería saber si se puede hacer algo.

Dejo el code
PHP Code:
buy_extra_item(iditemidignorecost 0)
{
    
// Retrieve item's team
    
static team
    team 
ArrayGetCell(g_extraitem_teamitemid)
    
    
// Check for team/class specific items
    
if ((g_zombie[id] && !g_nemesis[id] && !(team ZP_TEAM_ZOMBIE)) || (!g_zombie[id] && !g_survivor[id] && !(team ZP_TEAM_HUMAN)) || (g_nemesis[id] && !(team ZP_TEAM_NEMESIS)) || (g_survivor[id] && !(team ZP_TEAM_SURVIVOR)))
    {
        
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        return;
    }
    
    
// Check for unavailable items
    
if ((itemid == EXTRA_NVISION && !get_pcvar_num(cvar_extranvision))
    || (
itemid == EXTRA_ANTIDOTE && (!get_pcvar_num(cvar_extraantidote) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit)))
    || (
itemid == EXTRA_MADNESS && (!get_pcvar_num(cvar_extramadness) || g_madnesscounter >= get_pcvar_num(cvar_madnesslimit)))
    || (
itemid == EXTRA_INFBOMB && (!get_pcvar_num(cvar_extrainfbomb) || g_infbombcounter >= get_pcvar_num(cvar_infbomblimit)))
    || (
itemid >= EXTRA_WEAPONS_STARTID && itemid <= EXTRAS_CUSTOM_STARTID-&& !get_pcvar_num(cvar_extraweapons)))
    {
        
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        return;
    }
    
    
// Check for hard coded items with special conditions
    
if ((itemid == EXTRA_ANTIDOTE && (g_endround || g_swarmround || g_nemround || g_survround || g_plagueround || fnGetZombies() <= || (get_pcvar_num(cvar_deathmatch) && !get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() == 1)))
    || (
itemid == EXTRA_MADNESS && g_nodamage[id]) || (itemid == EXTRA_INFBOMB && (g_endround || g_swarmround || g_nemround || g_survround || g_plagueround)))
    {
        
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_CANTUSE")
        return;
    }
    
    
// Ignore item's cost?
    
if (!ignorecost)
    {
        
// Check that we have enough ammo packs
        
if (g_ammopacks[id] < ArrayGetCell(g_extraitem_costitemid))
        {
            
zp_colored_print(id"^x04[ZP]^x01 %L"id"NOT_ENOUGH_AMMO")
            return;
        }
        
        
// Deduce item cost
        
g_ammopacks[id] -= ArrayGetCell(g_extraitem_costitemid)
    }
    
    
// Check which kind of item we're buying
    
switch (itemid)
    {
        case 
EXTRA_NVISION// Night Vision
        
{
            
g_nvision[id] = true
            
            
if (!g_isbot[id])
            {
                
g_nvisionenabled[id] = true
                
                
// Custom nvg?
                
if (get_pcvar_num(cvar_customnvg))
                {
                    
remove_task(id+TASK_NVISION)
                    
set_task(0.1"set_user_nvision"id+TASK_NVISION__"b")
                }
                else
                    
set_user_gnvision(id1)
            }
            else
                
cs_set_user_nvg(id1)
        }
        case 
EXTRA_ANTIDOTE// Antidote
        
{
            
// Increase antidote purchase count for this round
            
g_antidotecounter++
            
            
humanme(id00)
        }
        case 
EXTRA_MADNESS// Zombie Madness
        
{
            
// Increase madness purchase count for this round
            
g_madnesscounter++
            
            
g_nodamage[id] = true
            set_task
(0.1"zombie_aura"id+TASK_AURA__"b")
            
set_task(get_pcvar_float(cvar_madnessduration), "madness_over"id+TASK_BLOOD)
            
            static 
sound[64]
            
ArrayGetString(zombie_madnessrandom_num(0ArraySize(zombie_madness) - 1), soundcharsmax(sound))
            
emit_sound(idCHAN_VOICEsound1.0ATTN_NORM0PITCH_NORM)
        }
        case 
EXTRA_INFBOMB// Infection Bomb
        
{
            
// Increase infection bomb purchase count for this round
            
g_infbombcounter++
            
            
// Already own one
            
if (user_has_weapon(idCSW_HEGRENADE))
            {
                
// Increase BP ammo on it instead
                
cs_set_user_bpammo(idCSW_HEGRENADEcs_get_user_bpammo(idCSW_HEGRENADE) + 1)
                
                
// Flash ammo in hud
                
message_begin(MSG_ONE_UNRELIABLEg_msgAmmoPickup_id)
                
write_byte(AMMOID[CSW_HEGRENADE]) // ammo id
                
write_byte(1// ammo amount
                
message_end()
                
                
// Play clip purchase sound
                
emit_sound(idCHAN_ITEMsound_buyammo1.0ATTN_NORM0PITCH_NORM)
                
                return; 
// stop here
            
}
            
            
// Give weapon to the player
            
fm_give_item(id"weapon_hegrenade")
        }
        default:
        {
            if (
itemid >= EXTRA_WEAPONS_STARTID && itemid <= EXTRAS_CUSTOM_STARTID-1// Weapons
            
{
                
// Get weapon's id and name
                
static weaponidwname[32]
                
ArrayGetString(g_extraweapon_itemsitemid EXTRA_WEAPONS_STARTIDwnamecharsmax(wname))
                
weaponid cs_weapon_name_to_id(wname)
                
                
// If we are giving a primary/secondary weapon
                
if (MAXBPAMMO[weaponid] > 2)
                {
                    
// Make user drop the previous one
                    
if ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)
                        
drop_weapons(id1)
                    else
                        
drop_weapons(id2)
                    
                    
// Give full BP ammo for the new one
                    
ExecuteHamB(Ham_GiveAmmoidMAXBPAMMO[weaponid], AMMOTYPE[weaponid], MAXBPAMMO[weaponid])
                }
                
// If we are giving a grenade which the user already owns
                
else if (user_has_weapon(idweaponid))
                {
                    
// Increase BP ammo on it instead
                    
cs_set_user_bpammo(idweaponidcs_get_user_bpammo(idweaponid) + 1)
                    
                    
// Flash ammo in hud
                    
message_begin(MSG_ONE_UNRELIABLEg_msgAmmoPickup_id)
                    
write_byte(AMMOID[weaponid]) // ammo id
                    
write_byte(1// ammo amount
                    
message_end()
                    
                    
// Play clip purchase sound
                    
emit_sound(idCHAN_ITEMsound_buyammo1.0ATTN_NORM0PITCH_NORM)
                    
                    return; 
// stop here
                
}
                
                
// Give weapon to the player
                
fm_give_item(idwname)
            }
            else 
// Custom additions
            
{
                
// Item selected forward
                
ExecuteForward(g_fwExtraItemSelectedg_fwDummyResultiditemid);
                
                
// Item purchase blocked, restore buyer's ammo packs
                
if (g_fwDummyResult >= ZP_PLUGIN_HANDLED && !ignorecost)
                    
g_ammopacks[id] += ArrayGetCell(g_extraitem_costitemid)
            }
        }
    }

Disculpen por revivir
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 10-24-2011 at 19:21. Reason: error de ortografía
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 10-25-2011 , 08:55   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#159

NP.

como lo tenias antes?
XINLEI is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 10-25-2011 , 10:58   Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#160

Quote:
Originally Posted by XINLEI View Post
NP.

como lo tenias antes?
así esta en el ZP 4.3 sin modificar
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode