new g_LogInCount[MAX_PLAYERS];
public OnGameModeInit() {
// This will make the variable automatically load and save for all players
BindUserVar("login-count", g_LogInCount);
}
public OnPlayerLogIn(playerid) {
// Increase by 1
g_LogInCount[playerid] += 1;
new buf[128];
format(buf, sizeof(buf), "* Welcome! You have logged in %d time(s).", g_LogInCount[playerid]);
SendClientMessage(playerid, 0xFFFFFFFF, buf);
}
new
g_Array[MAX_PLAYERS],
g_CharArray[MAX_PLAYERS char],
BitArray:g_y_bitArray<MAX_PLAYERS>,
Bit16:g_rBitsArray<MAX_PLAYERS>,
g_StringArray[MAX_PLAYERS][64],
g_2dArray[MAX_PLAYERS][10]
;
public OnGameModeInit() {
// The 1st argument is the name of the user var; it can be pretty much anything.
BindUserVar("array" , g_Array);
BindUserVar("char-array" , g_CharArray);
BindUserVar("bit-array" , g_y_bitArray);
BindUserVar("16bit-array", g_rBitsArray);
BindUserVarString("string-array", g_StringArray);
BindUserVarArray ("2d-array" , g_2dArray);
}
// Self-explanatory
bool:IsPlayerLoggedIn(playerid)
bool:IsPlayerRegistered(playerid)
// Fires the callback OnPlayerLogIn or OnPlayerFailLogIn when done
AuthPlayer(playerid, password[])
// Fires the callbacks OnPlayerRegister then OnPlayerLogIn when done
RegisterPlayer(playerid, password[])
// This is called automatically when a player disconnects
// but you might want to save the data more often (in case of a crash).
SavePlayerUserData(playerid)
// BindUserVar*
BindUserVar(key[], variable[])
BindUserVarArray(key[], variable[MAX_PLAYERS][])
BindUserVarString(key[], variable[MAX_PLAYERS][])
// GetUserVar*
GetUserVarArrayInt(playerid, key[], index)
Float:GetUserVarArrayFloat(playerid, key[], index)
GetUserVarInt(playerid, key[])
Float:GetUserVarFloat(playerid, key[])
GetUserVarString(playerid, key[], output[], output_size = sizeof(output))
// SetUserVar*
SetUserVar(playerid, key[], value)
SetUserVarArray(playerid, key[], iIndex, {_, Float}:xValue)
SetUserVarFloat(playerid, key[], Float:fValue)
SetUserVarInt(playerid, key[], iValue)
SetUserVarString(playerid, key[], /*const*/ szValue[])
// This is called when a player's name info is loaded (almost right after OnPlayerConnect).
public OnPlayerNameInfoLoad(playerid, bool:is_registered, bool:is_logged_in)
// This is called when a player was successfully registered.
public OnPlayerRegister(playerid)
// This is called when a player logs in (also called after a player registers).
public OnPlayerLogIn(playerid)
// This is called when a player enters the wrong password.
public OnPlayerFailLogIn(playerid)
// This is called right before the user data will be saved.
public OnPlayerUserDataSave(playerid)
This is my 1000th post, so I figured I might as well make it interesting.
|
This is my 1000th post, so I figured I might as well make it interesting. |
Posts: 999 |
There is a EPIC FAIL but also a good contribution for the community, great.
|
[ 128 ]
Very nice Job Slice!
I like the total time a lot. By the way, is important the hashed password be pawn Код:
|
The passwords will get hashed with Whirlpool and stored as binary objects, causing them to only take up around 70 bytes.
So in short, no, you should give that function unhashed passwords. |