Posts: 414
Threads: 93
Joined: Dec 2010
Quote:
Originally Posted by Threshold
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { GivePlayerMoney(playerid, -2000); SendClientMessage(playerid, 0xFF0000AA, "You have died. Your medical bill is: $2000"); GameTextForPlayer(playerid, "~r~Medical Bills: $2000", 5000, 5); return 1; }
|
or you would do
Quote:
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, 0xFF0000AA, "You have died. Your medical bill is: $2000");
GameTextForPlayer(playerid, "~r~Medical Bills: $2000", 5000, 5);
SetPlayerPos(playerid, ,-320.2867,1052.6426,20.3403);
return 1;
}
|
Posts: 414
Threads: 93
Joined: Dec 2010
Quote:
Originally Posted by Threshold
Ahh I didn't see the last bit... but no... that would set his position, then he would simply respawn somewhere else...
Can you please show me your OnPlayerSpawn function, so then I can edit it so you can respawn at that location.
|
I use something like this.
Quote:
new dead[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(Dead[playerid] != 0) { //basicly its saying that if the value = 0 it will tele him to the spawn point.
SetPlayerPos(playerid,,-320.2867,1052.6426,20.3403); //this is the hospital when you die
Dead[playerid] = 0;
}
else {
SetPlayerPos(playerid, x, y, z);// this teles you to spawn point when they pick a class first time
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Dead[playerid] = 1;
return 1;
}
|
Posts: 441
Threads: 19
Joined: Sep 2011
Reputation:
0
That's a very complex way of putting it... it could be alot simpler, but without having seen his OnPlayerSpawn function, I cannot generate the code for it...
Posts: 1,063
Threads: 52
Joined: Sep 2011
Reputation:
0
Do it with jueix's way, because actually you cannot Set the position of players on the OnPlayerDeath Callback, because the player is already dead and after that take place the OnPlayerSpawn part.