SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 20/04/2011, 06:42 PM   #1
captainjohn
Huge Clucker
 
captainjohn's Avatar
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 409
Reputation: 29
Default Random Spawns for each team

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.
captainjohn is offline  
Old 20/04/2011, 06:47 PM   #2
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,038
Reputation: 125
Default Re: Random Spawns for each team

Have a look here:

http://wiki.sa-mp.com/wiki/Random

Should help you out abit.
__________________

Peace...

Stigg is offline  
Old 20/04/2011, 06:49 PM   #3
captainjohn
Huge Clucker
 
captainjohn's Avatar
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 409
Reputation: 29
Default Re: Random Spawns for each team

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,
captainjohn is offline  
Old 20/04/2011, 07:37 PM   #4
captainjohn
Huge Clucker
 
captainjohn's Avatar
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 409
Reputation: 29
Default Re: Random Spawns for each team

Bumb.?
captainjohn is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Spawns + Previous Spawns XtremeChio Help Archive 2 01/09/2009 01:57 PM
Random Team Spawns and Freeze Time when Games Start basker Help Archive 0 15/07/2009 01:33 PM
Random Spawns Geekzor Help Archive 27 08/07/2009 03:54 PM


All times are GMT. The time now is 12:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.