02.04.2013, 16:11
How i can make somebody type dm so he gets teleported to random positions of dm and spawns in random positions after death until he types leavedm ?
//Top of your GM
new JoinedDM[MAX_PLAYERS];
//Where the player joins the DM
JoinedDM[playerid] = 1;
//Where the player leaves the DM AND OnPlayerDisconnect
JoinedDM[playerid] = 0;
//OnPlayerSpawn
if(JoinedDM[playerid] == 1)
{
switch(random(3))
{
case 0: SetPlayerPos(playerid, x0,y0,z0);
case 1: SetPlayerPos(playerid, x1,y1,z1);
case 2: SetPlayerPos(playerid, x2,y2,z2);
//(...) Replace xyz by their values.
}
}
///on the places of variables new Float:DM1[][4] = {x,y,z},////// put spawns but without angle {x,y,z}, {x,y,z}, {x,y,z}, {x,y,z} }; ///////in your onplayerspawn or in your /Dm command if (strcmp("/dm", cmdtext, true, 4) == 0) // /dm command { new rand = random(sizeof(DM1)); SetPlayerPos(playerid, DM1[rand][0], DM1[rand][1], DM1[rand][2]); // Rnadom DM Spawns