SA-MP Forums Archive
First Time - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: First Time (/showthread.php?tid=98958)



First Time - Hot - 24.09.2009

How to check if is the first time the player enters in the server?


Re: First Time - 0ne - 24.09.2009

ontop:

Код:
new entrance[MAX_PLAYERS];
connect:

Код:
if(entrance[playerid] == 0)
{
// do something
entrance[playerid] = 1;
}
else if(entrance[playerid] == 1)
{
// do sumthng.
}
return 1;
}
And i suggest save the entrance to a file or maybe this would work:

OnPlayerDisconnect:

Код:
entrace[playerid] = 1;
if not save it to a file onplayerdisconnect:

Код:
new Data[256];
  format(Data, 255, "Entrance/%s.ini", pName(playerid));
	dini_IntSet(Data, "Entrance", entrance[playerid]);
make sure you have pName function, or if u have another replace the pName with your function.

EDIT: If u use saving system make sure onplayerconnect u read it if he has entrance 1. (Or if it works without it then nvm this line.)


Re: First Time - Hot - 24.09.2009

Thanks.