Random spawn
#10

That'd be a simple variable like,
pawn Код:
new PlayerJoinedDMZone[MAX_PLAYERS];
When a player types the /dm command add in this;
pawn Код:
PlayerJoinedDMZone[playerid] = 1;
So when he dies he'll be spawned back inside the DM zone;
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;
}
Then simply, the /leavedm command would be something like this;
pawn Код:
CMD:leavedm(playerid, params[]) {
        PlayerJoinedDMZone[playerid] = 0;
        SendClientMessage(playerid, -1, "You've left the DM zone.");
        return 1;
}
Reply


Messages In This Thread
Random spawn - by Micko123 - 28.04.2016, 17:13
Re: Random spawn - by Luis- - 28.04.2016, 17:16
Re: Random spawn - by Micko123 - 28.04.2016, 17:19
Re: Random spawn - by Stinged - 28.04.2016, 17:19
Re: Random spawn - by Micko123 - 28.04.2016, 17:21
Re: Random spawn - by Luis- - 28.04.2016, 17:21
Re: Random spawn - by Micko123 - 28.04.2016, 17:24
Re: Random spawn - by Luis- - 28.04.2016, 17:28
Re: Random spawn - by Micko123 - 28.04.2016, 17:32
Re: Random spawn - by Luis- - 28.04.2016, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)