20.06.2009, 00:18
I understand
pawn Код:
new deathcount[MAX_PLAYERS];
new SpawnPos[4][MAX_PLAYERS];
//OnPlayerCommandText
if(strcmp(cmdtext,"/command",true)==0)
{
GetPlayerPos(playerid,SpawnPos[0][playerid],SpawnPos[1][playerid],SpawnPos[2][playerid]);
GetPlayerFacingAngle(playerid,SpawnPos[3][playerid]);
deathcount[playerid]=3;
return SendClientMessage(playerid,0xFF0000FF,"You will now spawn here 3 more times.");
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate==PLAYER_STATE_SPAWNED)
{
if(deathcount[playerid]>0)
{
SetPlayerPos(playerid,SpawnPos[0][playerid],SpawnPos[1][playerid],SpawnPos[2][playerid]);
SetPlayerFacingAngle(playerid,SpawnPos[3]);
deathcount[playerid]--;
}
}
}