SA-MP Forums Archive
Bitwise - Flags not turning on. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bitwise - Flags not turning on. (/showthread.php?tid=455976)



Bitwise - Flags not turning on. - thefatshizms - 04.08.2013

I have this for when a player logs in:
pawn Код:
PlayerVariables[playerid] |= PLAYER_LOGGED_IN;
SendClientMessage(playerid, COLOR_GREEN, "Logged in!");
And this on onplayerrequestclass:
pawn Код:
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.


Re: Bitwise - Flags not turning on. - Bakr - 04.08.2013

Show where you declare PLAYER_LOGGED_IN and the others.


Re: Bitwise - Flags not turning on. - thefatshizms - 04.08.2013

pawn Код:
enum PlayerVars:(<<=1)
{
    PLAYER_SPAWNED = 1,
    PLAYER_LOGGED_IN,
    PLAYER_IS_REGISTERED,

//and so on
}

new PlayerVars:PlayerVariables[MAX_PLAYERS];