Hello.
I'm creating a menu which player can disable.
Player settings are being stored in multi-dimensional
Code:
enum E_PLAYER {
menu_on = 1
}
new g_players[32][E_PLAYER]
But when player connects to the server this variable isn't set and I want it to be set on 1 or...
I want the plugin to recognize empty var as 1
Now I'm checking it using function below.
Code:
public menuStatusGet(id)
{
new out
if(equal(g_players[id][menu_on], "") || g_players[id][menu_on] == 1) {
client_print(id, print_chat, "MENU: its on")
out = 1
} else {
client_print(id, print_chat, "MENU: its off")
out = 0
}
client_print(id, print_chat, "menu_on equals: %d", g_players[id][menu_on])
return out
}
It is probably cause I'm using equal to check does its empty.
How should I check it so its will return correct value ?
Regards.