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

[ES][ZP] Ayuda con sistema de Niveles.


  
 
 
Thread Tools Display Modes
Author Message
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 09-25-2013 , 14:39   [ES][ZP] Ayuda con sistema de Niveles.
#1

Bueno, este es mi primer thread asique si estoy haciendo algo mal espero me corrijan.

Bueno, yo estoy empezando a armar un zp y puse este sistema de niveles:

Niveles por ammopacks By Kiske: http://forums.alliedmods.net/showthread.php?t=112692

Y tengo un problema, cuando uso la forma de Speed haciendo el Goto el sistema anda perfecto, pero dicen que esa forma consume más, asique quize probar con la de Capostrike93 pero al usar es forma no me suben los niveles. y lo que quiero saber es si alguien me puede ayudar a solucionar este problema.


Gracias de antemano.

Last edited by Axelromero91; 09-25-2013 at 14:40.
Axelromero91 is offline
Send a message via MSN to Axelromero91
Winchester90
Senior Member
Join Date: May 2013
Location: Dale! RG4L Baby
Old 09-26-2013 , 06:44   Re: [ES][ZP] Ayuda con sistema de Niveles.
#2

Cualquier cosa que hagas consume, dependiendo que lo hagas bien. Yo por mi parte te recomendaria usar la forma que mejor te vaya, no hagas caso a si consume mas o menos eso depende de ti. Por otra parte si no te sube de nivel algo estas haciendo mal.

Postea la parte en la que llamas al update y el update.
__________________
Proyectos No comercio XD
Zombie Resurection 1.0 (45%)
Winchester90 is offline
Axelromero91
Member
Join Date: Jun 2013
Location: Buenos Aires, Argentina
Old 09-26-2013 , 09:59   Re: [ES][ZP] Ayuda con sistema de Niveles.
#3

Aca es donde llamo al la funcion Update_ap:

PHP Code:
public fw_PlayerKilled(victimattackershouldgib)
{
    
// code code ... ...
    
    // Zombie/nemesis killed human, reward ammo packs
    
if (g_zombie[attacker] && (!g_nemesis[attacker] || !get_pcvar_num(cvar_nemignoreammo)))
        
update_ap(attackerget_pcvar_num(cvar_ammoinfect), 0)

    
// Code code ... ...

y en:

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
            
// Code Code ... ...
            
            // Reward ammo packs for every [ammo damage] dealt
            
while (g_damagedealt[attacker] >= ammodamage)
            {
                
update_ap(attacker10)
                
g_damagedealt[attacker] -= ammodamage
            
}
                 
// code code ... ...

                // Infection allowed
                
SendDeathMsg(attackervictim// send death notice
                
FixDeadAttrib(victim// fix the "dead" attrib on scoreboard
                
UpdateFrags(attackervictimget_pcvar_num(cvar_fragsinfect), 11// add corresponding frags and deaths
    
                
zombieme(victimattacker00// turn into zombie
                
update_ap(attackerget_pcvar_num(cvar_ammoinfect), 0// ammo packs given to zombie for infection
                
fm_set_user_health(attackerpev(attackerpev_health)+get_pcvar_num(cvar_zombiebonushp)) // attacker gets bonus HP for the infection
    
                
return HAM_SUPERCEDE;

PHP Code:
infection_explode(ent)
{     
        
// Code Code ... ...


        // Infected victim's sound
        
engfunc(EngFunc_EmitSoundvictimCHAN_VOICE,  grenade_infect_player[random_num(0sizeof grenade_infect_player 1)],  1.0ATTN_NORM0PITCH_NORM)
        
        
SendDeathMsg(attackervictim// send death notice
        
FixDeadAttrib(victim// fix the "dead" attrib on scoreboard
        
UpdateFrags(attackervictimget_pcvar_num(cvar_fragsinfect), 11// add corresponding frags & deaths        
        
        
zombieme(victimattacker01// turn into zombie
        
update_ap(attackerget_pcvar_num(cvar_ammoinfect), 0// ammo packs given to zombie for infection
        
fm_set_user_health(attackerpev(attackerpev_health)+get_pcvar_num(cvar_zombiebonushp)) // infection HP bonus
    

Y aca esta la funcion con la forma de capostrike93:
PHP Code:
public update_ap(idamountcheck)
{    
    if (!
check)
    {    
        
/*if (g_ammopacks[id] + amount > NIVELES[sizeof NIVELES - 1] - 1)
            return PLUGIN_HANDLED*/
    
        
g_ammopacks[id] += amount
    
}
    else
    {
        if(
amount 0)
        {
            if(
g_ammopacks[id] < EXPLVL(g_lvl[id]))
            {
                
g_lvl[id]--
                
client_print(idprint_center"Bajaste de nivel")
                
update_ap(id, -11)
            }
        }
        else
        {
            if(
g_ammopacks[id] >= EXPLVL(g_lvl[id]))
            {
                
g_lvl[id]++
                
client_print(idprint_center"Subiste de nivel")
                
update_ap(id01
            }
        }
    }
    
    return 
PLUGIN_HANDLED


aclaro que la linea que esta "comentada" la tube que poner asi porque use macros para la experiencia de cada nivel y con eso me tiraba error

Last edited by Axelromero91; 09-26-2013 at 10:04.
Axelromero91 is offline
Send a message via MSN to Axelromero91
 



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 03:56.


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