VARIABLE HELP! *REP+* - 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: VARIABLE HELP! *REP+* (
/showthread.php?tid=603764)
VARIABLE HELP! *REP+* -
_GHT_MarK445 - 27.03.2016
Hey guys, i have a little problem:
I am using in my enumerator variable pNews, which is supposed to be used for news, apllied on server. I am saving this variable in my register system, when player disconnects, like this:
Код:
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"News",PlayerInfo[playerid][pNews]);
INI_Close(File);
Now, in OnPlayerSpawn, i am working with this variable, like this:
Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pNews] == 0)
{
PlayerInfo[i][pNews] = 1;
SendClientMessage(playerid, COLOR_NEW, "From your last visit, there were some news added to the server, read in /news");
SendClientMessage(playerid, COLOR_NEW, "From your last visit, there were some news added to the server, read in /news");
SendClientMessage(playerid, COLOR_NEW, "From your last visit, there were some news added to the server, read in /news");
}
}
}
Basically i am looping through all spawned players, and if their pNews is setted on 0, which is default setting, it shows the message and sets it on 1, so it does not show again.
The problem here is, that is shows all the time, when i restart the server and upload a new version of gamemode, when the server is on and i am just relogging, everything is fine, the problem comes, when i am restarting server.
Do you guys have any ideas, what could case this issue? If yes, write down some, and if they will be working, i wont hesitate with giving you an reputation point.
Re: VARIABLE HELP! *REP+* -
K0P - 27.03.2016
Do you load the data On Player Connect?