Raised This Month: $ Target: $400
 0% 

[ZP] Send only 1 message when level up


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pawnsito
New Member
Join Date: Nov 2018
Old 11-28-2018 , 17:09   [ZP] Send only 1 message when level up
Reply With Quote #1

Hi guys, first of all, sorry for my bad english, you should know this is not my primary language so..

The problem is this i have this code

PHP Code:
public update_ap(idamountcheck)
{
    if (
check) goto check2 // Lo que hace el "goto" es, si la Funcion esta se llamo desde "check", el Plugin lo que hara, es llamar directamente a "check2".
   
    // Aca detectamos que si es Nivel Maximo no suba mas.
    
if (g_ammopacks[id] + amount NIVELES[sizeof NIVELES 1] - 1)
        return 
PLUGIN_HANDLED
    
    
// Le damos los APs correspondientes.
    
g_ammopacks[id] += amount
    
    
// Ya lo dijimos antes ^^.
    
check2:
    if(
amount 0)
    {
        if(
g_ammopacks[id] < NIVELES[g_level[id]] )
        {
            
g_level[id]--
            
client_print(idprint_center"Bajaste de nivel")
            
update_ap(id, -11)
        }

    }
    else
    {
        if(
g_ammopacks[id] >= NIVELES[g_level[id]] )
        {
            
g_level[id]++
            
client_print(idprint_center"Subiste de nivel")
            
update_ap(id01
        }
    }
    
    return 
PLUGIN_HANDLED

The problem is, whenever a player level up 2 or more levels, instantanly the print
PHP Code:
client_print(idprint_center"Subiste de nivel"
Is showed more than 1 times, it spawn a lot 2 , 3 , 4 .... 100 times depend on how many levels they level up,

How i can make it to send just one print with the final level you got?

example: if i level up with 1 hit from level 1 to 6 only show
CONGRATULATIONS YOU LEVEL UP TO LEVEL %d", g_level[id])

instead of get the 6 messages

ty.
pawnsito is offline
 



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


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