SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 15/10/2009, 03:54 PM   #1
Tigerbeast11
Gangsta
 
Join Date: Aug 2009
Posts: 771
Reputation: 2
Default [HELP]How to Create Random Spawns?

Please, i need to know how to create a random spawn, can anyone help?

Here is the code:
Code:
	SetPlayerPos(playerid, 2493.9133, -1682.3986, 13.3382);
 	SetPlayerInterior(playerid, 0); //grove st. spawn
 	
 	SetPlayerPos(playerid, -2617.5156, 1390.6353, 7.1105);
 	SetPlayerInterior(playerid, 0);//jizzy spawn
 	
 	SetPlayerPos(playerid, 2028.5538, 1008.3543, 10.8203);
  SetPlayerInterior(playerid, 0);//4 dragons casino spawn
  
  SetPlayerPos(playerid, 1541.2833, -1362.4741, 329.6457);
  	SetPlayerInterior(playerid, 0);//starfish tower
How can i create random spawns at these places?
Tigerbeast11 is offline  
Old 15/10/2009, 05:21 PM   #2
dice7
High-roller
 
Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
Default Re: [HELP]How to Create Random Spawns?

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

pawn Code:
new a = random(3);
if(a == 0)
{
  //something
}
else if(a == 1)
{
  //something
}

Or better yet, use a switch
dice7 is offline  
Old 03/02/2010, 06:23 AM   #3
Kyeno
Little Clucker
 
Join Date: Oct 2008
Posts: 33
Reputation: 0
Default Re: [HELP]How to Create Random Spawns?

Or even better, use an array and random() function
__________________
Please have a laugh and visit creative fails repository at http://ifixed.it/
Kyeno 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
how do i create weapon spawns johnathon956 Help Archive 9 24/08/2010 09:18 AM
[HELP] How can i create random spawns? akis_tze Help Archive 1 14/11/2009 10:53 PM
Random Spawns + Previous Spawns XtremeChio Help Archive 2 01/09/2009 01:57 PM
[HELP]A DM with random spawns 17badboy17 Help Archive 3 03/04/2009 08:13 PM


All times are GMT. The time now is 11:30 PM.


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