30.05.2013, 11:06
If I managed to understand your extremely broken english properly, I guess you're talking about a some kind of "death mode" ?
If so, you need to trigger a variable as true once a player dies and sets its position to where he died. Quite simple. Here's a demonstration:
If so, you need to trigger a variable as true once a player dies and sets its position to where he died. Quite simple. Here's a demonstration:
pawn Код:
new bool:DID_IJUSTDIE[MAX_PLAYERS];
new Float:MYCOOL_COORDS[MAX_PLAYERS][4];
public OnPlayerSpawn(playerid)
{
if(DID_IJUSTDIE[playerid])
SetPlayerPos(playerid, MYCOOL_COORDS[playerid][0], MYCOOL_COORDS[playerid][1], MYCOOL_COORDS[playerid][2]),
SetPlayerFacingAngle(playerid, MYCOOL_COORDS[playerid][3]),
TogglePlayerControllable(playerid, false),
DID_IJUSTDIE[playerid] = false;
return 1;
}
public OnPlayerDeath(playerid)
{
DID_IJUSTDIE[playerid] = true;
GetPlayerPos(playerid, MYCOOL_COORDS[playerid][0], MYCOOL_COORDS[playerid][1], MYCOOL_COORDS[playerid][2]);
GetPlayerFacingAngle(playerid, MYCOOL_COORDS[playerid][3]);
return 1;
}