Random spawn in dm
#4

Are you asking for something like this

pawn Код:
OnPlayerDeath(playerid)
{
    SetPVarInt(playerid, "ToSpawnAfterDeath", 1);
return 1;
}
OnPlayerSpawn(playerid)
{
    if(GetPVarInt(playerid) == 1)
    {
        new rand=random(4)//you can change 4 for the number of positions you have
        switch(rand)
        {
             case 0:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.ґ
             case 1:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.
             case 2:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.
             case 3:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.


        }
    }
}
And if you want him to spawn randomly every time he spawns, just leave it like this:

[pawn]
Are you asking for something like this

pawn Код:
OnPlayerDeath(playerid)
{
    SetPVarInt(playerid, "ToSpawnAfterDeath", 1);
return 1;
}
OnPlayerSpawn(playerid)
{
        new rand=random(4)//you can change 4 for the number of positions you have
        switch(rand)
        {
             case 0:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.ґ
             case 1:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.
             case 2:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.
             case 3:SetPlayerPos(playerid, X, Y, Z); // WHERE X, Y and Z are the coordinates of the place where you want him to spawn so is a must change.


        }
}
Reply


Messages In This Thread
Random spawn in dm - by IvancheBG - 17.04.2011, 19:58
Re: Random spawn in dm - by Stigg - 17.04.2011, 19:59
Re: Random spawn in dm - by IvancheBG - 17.04.2011, 20:01
Re: Random spawn in dm - by nemesis_567 - 17.04.2011, 20:06
Re: Random spawn in dm - by Alby Fire - 17.04.2011, 20:08
Re: Random spawn in dm - by blackwave - 17.04.2011, 20:09
Re: Random spawn in dm - by nemesis_567 - 17.04.2011, 20:09
Re: Random spawn in dm - by [M.A]Angel[M.A] - 17.04.2011, 20:13
Re: Random spawn in dm - by IvancheBG - 17.04.2011, 20:40
Re: Random spawn in dm - by [M.A]Angel[M.A] - 18.04.2011, 02:19

Forum Jump:


Users browsing this thread: 2 Guest(s)