Need Help with Random Spawns.
#3

This is from the LVDM mod.

On top add this:
pawn Код:
forward SetPlayerRandomSpawn(playerid);
pawn Код:
new iSpawnSet[MAX_PLAYERS];
pawn Код:
new Float:gRandomPlayerSpawns[23][3] = {
{-1973.7426,138.1529,27.6875},
{-2419.9260,334.5296,35.1787},
{-2648.5071,-33.4705,6.1328},
{-2207.2595,618.4319,44.4432},
{-2157.3359,657.8699,52.3707},
{-2117.7859,925.1335,86.0791},
{-1987.0775,1118.0575,54.1189},
{-2617.6216,1392.4672,7.1016},
{-1635.5897,1200.8304,7.1875},
{-1648.9873,417.7293,7.1875}
};
pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, PocketMoney);
    SetPlayerInterior(playerid,0);
    SetPlayerRandomSpawn(playerid);
    TogglePlayerClock(playerid,1);
    return 1;
}
pawn Код:
public SetPlayerRandomSpawn(playerid)
{
  if (iSpawnSet[playerid] == 0)
  {
        new rand = random(sizeof(gRandomPlayerSpawns));
        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);
    }
    return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    iSpawnSet[playerid] = 0;
    return 1;
}
Reply


Messages In This Thread
Need Help with Random Spawns. - by Lynax - 05.11.2009, 14:04
Re: Need Help with Random Spawns. - by RyDeR` - 05.11.2009, 14:50
Re: Need Help with Random Spawns. - by Benne - 05.11.2009, 15:25

Forum Jump:


Users browsing this thread: 4 Guest(s)