Loading Wrong Data
#1

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

Код:
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;
}
and load data code

Код:
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;
}
rep+ to everyone who gonna help me, thanks
Reply
#2

Where you put
PHP код:
LoadData_data 
Cannot see that line.
Reply
#3

Quote:
Originally Posted by SoFahim
Посмотреть сообщение
Where you put
PHP код:
LoadData_data 
Cannot see that line.
Код:
	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");
	}
Reply
#4

Check this Tutorial to learn...

https://sampforum.blast.hk/showthread.php?tid=352703

If you learn from this tutorial, you can make without any problem like this

+rep if this help you..
Reply
#5

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
Check this Tutorial to learn...

https://sampforum.blast.hk/showthread.php?tid=352703

If you learn from this tutorial, you can make without any problem like this

+rep if this help you..
I am making an admin fs and I followed this tut on some steps anyway I modified a little bit the script to get player's name before load I will test when I will have time, I gave you rep+ cuz you are greek
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)