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(id, amount, check)
{
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(id, print_center, "Bajaste de nivel")
update_ap(id, -1, 1)
}
}
else
{
if(g_ammopacks[id] >= NIVELES[g_level[id]] )
{
g_level[id]++
client_print(id, print_center, "Subiste de nivel")
update_ap(id, 0, 1)
}
}
return PLUGIN_HANDLED
}
The problem is, whenever a player level up 2 or more levels, instantanly the print
PHP Code:
client_print(id, print_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.