Posts: 26
Threads: 4
Joined: Feb 2012
Reputation:
0
Hello
So when player get killed how to set that he respawn on that same location and not on login location?
tnx
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by isheremse
tnx for that, but.....
I have one OnPlayerSpawn and OnPlayerDeath location and when i change it with your script, it works but on player login it spawn me on some different location not on original one.
I want to save original spawn position on player login but when player go somewhere and get killed, then i want that your script work and spawn on kill position.
|
That's because you have already custom spawn coordinates, remove it and then add the code that Anonym2009 gave you.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by isheremse
I have done that, and it work for that coordinate, but i want to keep my original coordinate of spawn point.
And then when player leave from original spawn point and get killed elsewhere, he can respawn on kill position and move on, not to be reset to original spawn.
|
You should set a FirstSpawn variable or something, add by +1 on the first death and then add your custom spawn coordinates.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Something like this:
pawn Код:
new FirstSpawn[MAX_PLAYERS];
OnPlayerDeath:
FirstSpawn[playerid] =1;
OnPlayerSpawn:
if(FirstSpawn[playerid] == 1)
{
//Your custom spawn coordinates
}
This won't 100% work, it's untested, better you set a bool with true or false conditions.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Posts: 26
Threads: 4
Joined: Feb 2012
Reputation:
0
damn...i can't get it to work, can i put here OnPlayerSpawn and OnPlayerDeath script to solve this?