PDA

View Full Version : Bitwise - Flags not turning on.


thefatshizms
04/08/2013, 01:07 AM
I have this for when a player logs in:
PlayerVariables[playerid] |= PLAYER_LOGGED_IN;
SendClientMessage(playerid, COLOR_GREEN, "Logged in!");

And this on onplayerrequestclass:

if(!(PlayerVariables[playerid] & PLAYER_LOGGED_IN)) {
new Query[100];
format(Query, 100, "SELECT `username` FROM `users` WHERE `username`='%s'", PlayerName(playerid));
mysql_function_query(Gconnection, Query, true, "OnPlayerRequestLoginRegister", "d", playerid);

}

Which gives you the dialog etc.

I login, get the message "Logged in!", yet it then displays the dialog again while going through skins.

Bakr
04/08/2013, 01:53 AM
Show where you declare PLAYER_LOGGED_IN and the others.

thefatshizms
04/08/2013, 12:37 PM
enum PlayerVars:(<<=1)
{
PLAYER_SPAWNED = 1,
PLAYER_LOGGED_IN,
PLAYER_IS_REGISTERED,

//and so on
}

new PlayerVars:PlayerVariables[MAX_PLAYERS];