09.07.2015, 16:06
Hello guys I have a problem when I join the server and I am alone everything is working perfect but when I am already in server and someone else join it will may load the my data and he will take admin and every level
onplayerconnect code
and load data code
rep+ to everyone who gonna help me, thanks
onplayerconnect code
Код:
public OnPlayerConnect(playerid) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadData_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login - "yellow"sbAdmin",""white"Welcome back on "red""SERVER_NAME""white", insert your password bellow\n"white"to login on your account",""yellow"Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register - "yellow"sbAdmin",""white"Welcome on "red""SERVER_NAME""white", insert your password bellow\n"white"to register an account",""yellow"Register","Quit"); } #if USE_LOGINSONG == YES PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/u0br7hzq01/intro.mp3"); #endif #if USE_LOGINCC == YES for(new i = 0; i < 100; i++) { SCM(playerid, -1," "); } #endif SCM(playerid, -1, ""orange"[sbAdmin]: "white""SERVER_NAME" is using "yellow"SecretBoss"white"'s Admin Filterscript"); CountPlayers ++; new string[128]; format(string, sizeof(string), ""orange"["SERVER_TAG"] "white"There are currently %d players online since you joined", CountPlayers); SCM(playerid, -1, string); #if USE_JOINMSG == YES if(PlayerData[playerid][pAdmin] >= 1) { format(string, sizeof(string), ""orange"["SERVER_TAG"] "white"Admin %s("yellow"%d"white") has joined the server", pName(playerid), playerid); SendClientMessageToAll(-1, string); } else { format(string, sizeof(string), ""orange"["SERVER_TAG"] "white"%s("yellow"%d"white") has joined the server", pName(playerid), playerid); SendClientMessageToAll(-1, string); } #endif // Sets players random color to avoid black color SetPlayerColor(playerid, RandomColors[random(200)]); #if USE_ANTIBOT == YES if(CountIP(pIP(playerid)) >= 6) return BanAll(playerid), 0; MAX_PLAYERS_ = playerid > MAX_PLAYERS_ ? playerid : GetHighestID(), npc[playerid] = bool:IsPlayerNPC(playerid), var[playerid] = SetTimerEx("BSS",2500,false,"i",playerid), warns[playerid] = 0; #endif return 1; }
Код:
public:LoadData_data(playerid,name[],value[]) { INI_Int("Password", PlayerData [playerid] [pPass]); INI_Int("Cash", PlayerData [playerid] [pCash]); INI_Int("Score", PlayerData [playerid] [pScore]); INI_Int("Admin", PlayerData [playerid] [pAdmin]); INI_Int("VIP", PlayerData [playerid] [pVIP]); INI_Int("Kills", PlayerData [playerid] [pKills]); INI_Int("Deaths", PlayerData [playerid] [pDeaths]); INI_Int("Helper", PlayerData [playerid] [pHelper]); return 1; }