Save Positions.
#1

I have add'ed this:

In enum pInfo:
Код:
	Float:pCrashPos_x,
	Float:pCrashPos_y,
	Float:pCrashPos_z,
In OnPlayerConnect(playerid):
Код:
	SetPlayerPos(playerid, PlayerInfo[playerid][pCrashPos_x], PlayerInfo[playerid][pCrashPos_y], PlayerInfo[playerid][pCrashPos_z]);
In OnPlayerDisconnect(playerid):
Код:
	GetPlayerPos(playerid, PlayerInfo[playerid][pCrashPos_x], PlayerInfo[playerid][pCrashPos_y], PlayerInfo[playerid][pCrashPos_z]);
WHAT I WANT TO DO? : When you disconnect from the server, your positions save, and after you log in to be in that positions ..
Reply
#2

What's going wrong?

Although I do suspect that the position gotten from OnPlayerDisconnect is going to be wrong, as by the stage that code runs the character will have already been removed. Also using that in OnPlayerConnect won't work properly, they have to spawn first.
Reply
#3

When i connect, i am spawned where is the faction spawn ..
Reply
#4

Well your position is probably being set after you've already set it to the CrashPos, so you're going to have to work your way around that. I can't help you there, I don't have your script.
Reply
#5

Tell me a solution, how can i resolve this ..
Reply
#6

Okay, the solution is to put the SetPlayerPos code in OnPlayerSpawn instead, and you need to stop the SetPlayerPos part for the faction if you've already set the players position to the crash position.

I don't know how else we can solve things for you if we don't know what your script contains mate.
Reply
#7

THANKS MAN !

Worked !

NO! I have another problem..

Now when i DIE, i have my last QUIT position ..
Reply
#8

Use this code when you login, and not at OnPlayerSpawn.
Reply
#9

That doesn't work. Look at first reply.. I do that first time, and it doesn't work.
Reply
#10

Make a something like FirstSpawn[MAX_PLAYERS];
At OnPlayerConnet you put FirstSpawn[playerid] = 1;
At onplayerspawn:
Код:
if(FirstSpawn[playerid] == 1)
{
	FirstSpawn[playerid] = 0;
 	// Set the quit pos
}
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)