28.04.2016, 17:37
That'd be a simple variable like,
When a player types the /dm command add in this;
So when he dies he'll be spawned back inside the DM zone;
Then simply, the /leavedm command would be something like this;
pawn Код:
new PlayerJoinedDMZone[MAX_PLAYERS];
pawn Код:
PlayerJoinedDMZone[playerid] = 1;
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
if(PlayerJoinedDMZone[playerid] == 1) {
new randomcoords = random(sizeof(DMSpawn));
SetPlayerPos(playerid, DMSpawn[randomcoords][0], DMSpawn[randomcoords][1], DMSpawn[randomcoords][2]);
}
return 1;
}
pawn Код:
CMD:leavedm(playerid, params[]) {
PlayerJoinedDMZone[playerid] = 0;
SendClientMessage(playerid, -1, "You've left the DM zone.");
return 1;
}