Looking for a function to check if a player is new
#1

Hello, I wanted to make an rp server, but im only stuck on one thing, making new players spawn at a position, if there is, what can i do to make new players spawn at a specified position.
Reply
#2

Quote:
Originally Posted by Jamcraftadam
Посмотреть сообщение
Hello, I wanted to make an rp server, but im only stuck on one thing, making new players spawn at a position, if there is, what can i do to make new players spawn at a specified position.
DO you mean new players, whohave just entered the server? Or who entered it the first time in their life?

In case of first occation:
1.Create a player variable, for example:
Код:
 NewPlayer[MAX_PLAYERS];
2.To OnPlayerConnect put:
Код:
 NewPlayer[playerid]=1;
3.To OnPlayerDisconnect put:
Код:
 NewPlayer[playerid]=0;
4.In OnPlayerSpawn put:
pawn Код:
if(NewPlayer[playerid] == 1) SetPlayerPos(/*set position for new player*/);
else SetPlayerPos(/*Set position for old players*/);
In case of second occation: You need to use registration system
Reply
#3

Quote:
Originally Posted by pasha97
Посмотреть сообщение
DO you mean new players, whohave just entered the server? Or who entered it the first time in their life?

In case of first occation:
1.Create a player variable, for example:
Код:
 NewPlayer[MAX_PLAYERS];
2.To OnPlayerConnect put:
Код:
 NewPlayer[playerid]=1;
3.To OnPlayerDisconnect put:
Код:
 NewPlayer[playerid]=0;
4.In OnPlayerSpawn put:
pawn Код:
if(NewPlayer[playerid] == 1) SetPlayerPos(/*set position for new player*/);
else SetPlayerPos(/*Set position for old players*/);
In case of second occation: You need to use registration system
Im using YINI, Ive got the saving done, i dont know how i can load it, It says undefined symbol X ect
Reply
#4

use fexist.

I suppose you're saving them by the users name?

Then do something like this:

pawn Код:
new file[32], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Users/%s.ini", name);
if(!fexist(file)) { /* Set the player pos when he's not registered */ }
else if(fexist(file)) { /* Set the player pos when he's registered */ }
Reply
#5

Im already done my login system using YINI, just not defining X Y Or Z, they are all in my enums and ini_write/float
Reply
#6

Quote:
Originally Posted by pasha97
Посмотреть сообщение
DO you mean new players, whohave just entered the server? Or who entered it the first time in their life?

In case of first occation:
1.Create a player variable, for example:
Код:
 NewPlayer[MAX_PLAYERS];
2.To OnPlayerConnect put:
Код:
 NewPlayer[playerid]=1;
3.To OnPlayerDisconnect put:
Код:
 NewPlayer[playerid]=0;
4.In OnPlayerSpawn put:
pawn Код:
if(NewPlayer[playerid] == 1) SetPlayerPos(/*set position for new player*/);
else SetPlayerPos(/*Set position for old players*/);
In case of second occation: You need to use registration system
Thank you soo much, il try this, sorry for late reply
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)