How to make random spawn locations??????
#1

Hey guys is there a way to create random spawn locations when teleporting to a location ? The map i created has a car deathmatch teleport . But when players join this teleport,they spawn at the same location.So i want players to spawn players at different parts of the map when teleported.
Ur help will be really appreciated
Reply
#2

next time use Search Function.
here's the tutorial.
https://sampforum.blast.hk/showthread.php?tid=162488
Reply
#3

Or you can try this, it's simple and easier :
pawn Код:
//-------------------------RANDOM SPAWN-----------------------------------------
    switch(random(13))
    {
    case 0:
    {
        SetPlayerPos(playerid,403.8893,2450.7117,16.5000); // aa
    }
    case 1:
    {
        SetPlayerPos(playerid,1286.9517,1277.3640,10.8203); // lvair
    }
    case 2:
    {
        SetPlayerPos(playerid,2003.8845,1544.9501,14.4018); // lv
    }
    case 3:
    {
        SetPlayerPos(playerid,-359.6938,1590.2939,76.7771); // drift
    }
    case 4:
    {
        SetPlayerPos(playerid,-2674.5376,1338.2960,19.5308);  // jizzy
    }
    case 5:
    {
        SetPlayerPos(playerid,-1974.9318,252.0767,35.1719); // sf
    }
    case 6:
    {
        SetPlayerPos(playerid,-1394.3132,-192.7000,14.1462); // sfair
    }
    case 7:
    {
        SetPlayerPos(playerid,539.5621,-1878.8409,3.7659); // plaja
    }
    case 8:
    {
        SetPlayerPos(playerid,1509.4786,-1707.0342,14.0469); // ls
    }
    case 9:
    {
        SetPlayerPos(playerid,1546.4701,-2639.8149,13.7103); // lsair
    }
    case 10:
    {
        SetPlayerPos(playerid,2489.0271,-1666.3361,13.3438); // grove
    }
    case 11:
    {
        SetPlayerPos(playerid,-2308.1331,-1635.5887,483.8453); // chilliad
    }
    case 12:
    {
        SetPlayerPos(playerid,-2228.9978,2325.5264,7.6303); //pimps
    }
}
Add it under OnPlayerSpawn !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)