Raised This Month: $ Target: $400
 0% 

Zombie Level Up System


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-05-2014 , 08:15   Re: Zombie Level Up System
Reply With Quote #2

I think the problem is here:
PHP Code:
public zp_user_infected_pre(idinfector)
{
    if( 
is_user_alive(infector) && (level_exp[infector] < (g_level_exp[infector] - 1)) && zp_get_user_zombie(infector))
    {
        
level_exp[infector] = level_exp[infector] + 1;
        
Level_Save(infector);
    }
    else
    if (
zp_get_user_zombie(infector))
        
ChatColor(infector"!g[ZP] !y Killed Zombie")

In the first if() you check if the player 'infector' is valid but you don't do so in the second if().

Change it to this:
PHP Code:
public zp_user_infected_pre(idinfector)
{
    if( 
is_user_alive(infector) && zp_get_user_zombie(infector))
    {
        if((
level_exp[infector] < (g_level_exp[infector] - 1)))
        {
            
level_exp[infector]++;
            
Level_Save(infector);
        }
        
        
ChatColor(infector"!g[ZP] !y Killed Zombie");
    }


Last edited by mottzi; 07-05-2014 at 08:21.
mottzi is offline
Send a message via MSN to mottzi
 



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 21:07.


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