Need help for random spawns
#1

Hi guys,
I've been trying to make random spawns as i'm a new scripter and scripting my new tdm script, But i've created teams and i want to add random spawns for a team. Anyone help?!
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=273529
Reply
#3

friend i need your help please help me i'm tired
Reply
#4

can you help me please how to install zadmin 4.2 my pc
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=279892#

search the ### INSTALLATION:
Reply
#6

PHP код:
new Float:RandomSpawn[][4] = //Here we create an 2D to hold the random spawns (Don't forget the float tag because coordinations are float.
{
    
//Add locations X, Y, Z, Facing Angle (Throw your random locations here)
    
{0.00.00.00.0},
    {
5.49.210.50.0},
    {
800.0,100.6,50.70.0}
};
CMD:spawn(playerid//A small command will teach you how to grab the random location
{
    new 
rnd random(sizeof(RandomSpawn)); //Here we declare a new variable to hold the random number of the row in the array (size of random spawn here returns 3 because we have 3 locations set) (random will return random one of them)
    
SetPlayerPos(playeridRandomSpawn[rnd][0], RandomSpawn[rnd][1], RandomSpawn[rnd][2]); //Now that we got the random number we just set the x which is in the column 0 and y in col 1 and z in col 2..
    
SetPlayerFacingAngle(playeridRandomSpawn[rnd][3]); //Last the facing angle
    
return 1;

You can throw that code on player spawn instead of this command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)