Need Help with Random Spawns.
#1

Hey m8's i want make Random Spawns.
But not teams . Just players random spawns when they dead..

I have cordinates...
Код:
//AddPlayerClass(120,-2027.5972,-47.4725,36.5650,180.1760,0,0,0,0,0,0); //
(-1973.7426,138.1529,27.6875,91.5776,0,0,0,0,0,0); //
(-2419.9260,334.5296,35.1787,242.3133,0,0,0,0,0,0); //
(-2648.5071,-33.4705,6.1328,180.2499,0,0,0,0,0,0); //
(-2207.2595,618.4319,44.4432,182.8331,0,0,0,0,0,0); //
(-2157.3359,657.8699,52.3707,230.8688,0,0,0,0,0,0); //
(-2117.7859,925.1335,86.0791,87.4443,0,0,0,0,0,0); //
(-1987.0775,1118.0575,54.1189,269.8715,0,0,0,0,0,0); //
(-2617.6216,1392.4672,7.1016,247.1442,0,0,0,0,0,0); //
(-1635.5897,1200.8304,7.1875,246.9165,0,0,0,0,0,0); //
(-1648.9873,417.7293,7.1875,230.1350,0,0,0,0,0,0); //
How to? Thanks ...
Reply
#2

Check the LVDM mode.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)