11.11.2015, 11:02
I'm having a small issue with my MySQL account system.
When I am loading an account, or create a new account in the script it sets the "pAdmin" variable to 50.
I have no idea why it's doing it, here is the loading (Everything else loads as it should)
This is DefaultPlayerValues
Here is a test command I created to check it, and it prints "50".
Any ideas?
EDIT: Here's my SQL config (table)
When I am loading an account, or create a new account in the script it sets the "pAdmin" variable to 50.
I have no idea why it's doing it, here is the loading (Everything else loads as it should)
pawn Код:
forward OnLoadAccount(playerid);
public OnLoadAccount(playerid){
if(!cache_num_rows()){
format(str, sizeof(str), "Welcome to Project Roleplay, %s.\n\nThis account exists; login by entering your password below:\n\n{FF0000}INVALID PASSWORD", PlayerRPName(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "GTA - Project Roleplay: {FFFFFF}Login", str, "Login", "Quit");
return 1;
}
DefaultPlayerValues(playerid);
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID", sqlConnection);
PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin", sqlConnection);
PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin", sqlConnection);
PlayerInfo[playerid][pFaction] = cache_get_field_content_int(0, "Faction", sqlConnection);
PlayerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank", sqlConnection);
format(PlayerInfo[playerid][pIP], 20, "%s", PlayerIP(playerid));
SendClientMessage(playerid, COLOR_YELLOW, "You have successfully logged into Project Roleplay. Enjoy your stay!");
SetPlayerToSpawn(playerid, SPAWN_NEWB);
LoggedIn[playerid] = true;
return 1;
}
pawn Код:
stock DefaultPlayerValues(playerid){
PlayerInfo[playerid][pID] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pSkin] = NEWB_SKIN; LoggedIn[playerid] = false; PlayerInfo[playerid][pFaction] = 0;
PlayerInfo[playerid][pRank] = 0;
return 1;
}
Here is a test command I created to check it, and it prints "50".
pawn Код:
CMD:test(playerid, params[]){
format(str, sizeof(str), "Admin VAR: %d", PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid, COLOR_WHITE, str);
return 1;
}
EDIT: Here's my SQL config (table)