Random Spawns for each team
#1

Hi I am creating a gamemode and I am currently creating the random spawns for each team.

I have TEAM_GROVE and TEAM_BALLAS.

I have saved several spawn places for each team but I want to make them random spawn points for when they die and for when they select class.

This is my AddPlayerClass

pawn Code:
public OnGameModeInit()
{
    // Grove Street
    AddPlayerClass(105, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 500, 30, 500, 28, 1500);
    AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 23, 500, 25, 500, 32, 1500);
    AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 22, 500, 27, 500, 28, 1500);
    // Ballas
    AddPlayerClass(102, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 500, 30, 500, 28, 1500);
    AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 23, 500, 25, 500, 32, 1500);
    AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 22, 500, 27, 500, 28, 1500);
           
return 1;
}
The current co-ordinates in the code I don't want, I want them to spawn at random places.
Here are the random spawn points I want.

Grove:
Code:
2500.8694, -1651.9243, 13.5247
2484.9863, -1651.3190, 13.4710
2488.1226, -1668.0736, 13.3438
2491.0566, -1686.1968, 13.5112
2476.2397, -1683.6807, 13.4056
2512.6519, -1673.8312, 13.5072
2517.1736, -1665.9335, 14.0061
Ballas:
Code:
2175.7915, -1670.8169, 14.9936
2165.6758, -1687.2319, 15.0859
2169.5676, -1685.7382, 15.0859
2146.3896, -1684.7439, 15.0859
2157.0796, -1660.6646, 15.0859
2169.2178, -1649.1034, 14.9235
I also want to add random spawns for each team for when they die and come back.
I don't want Grove Street to spawn in Ballas and I don't want Ballas to spawn in Grove Street.
Reply
#2

Have a look here:

https://sampwiki.blast.hk/wiki/Random

Should help you out abit.
Reply
#3

I sort of know how to do that but I am not sure on how to get TEAM_GROVE to spawn at TEAM_GROVE places and TEAM_BALLAS to spawn at TEAM_BALLAS places,
Reply
#4

Bumb.?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)