SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 23/05/2014, 07:02 PM   #1
SKAzini
Huge Clucker
 
SKAzini's Avatar
 
Join Date: Jun 2012
Posts: 376
Reputation: 17
Default Totally random spawn positions

RandomSpawn
Spawns a player anywhere inside the borders of San Andreas (not underwater or on top of buildings).



.zip (MapAndreas included): Dropbox
Pastebin (MapAndreas required): http://pastebin.com/tdr9KsUQ

Example of usage:

pawn Code:
public OnPlayerSpawn(playerid)
{
    CallRemoteFunction("RandomSpawn", "dd", playerid, 1); //1 if you want to freeze the player until he spawns, 0 if you don't
    return 1;
}

Don't forget to add "plugins mapandreas" and "filterscripts RandomSpawn" to server.cfg.

Enjoy.

Last edited by SKAzini; 31/05/2014 at 06:37 PM.
SKAzini is offline   Reply With Quote
Old 23/05/2014, 07:11 PM   #2
AroseKhanNiazi
High-roller
 
AroseKhanNiazi's Avatar
 
Join Date: Jan 2014
Location: Pakistan
Posts: 1,353
Reputation: 78
Default Re: Totally random spawn positions

but will it some time spawn in air or water some thing like that ?? but good any way
AroseKhanNiazi is offline   Reply With Quote
Old 23/05/2014, 07:18 PM   #3
SKAzini
Huge Clucker
 
SKAzini's Avatar
 
Join Date: Jun 2012
Posts: 376
Reputation: 17
Default Re: Totally random spawn positions

Quote:
Originally Posted by AroseKhanNaizi View Post
but will it some time spawn in air or water some thing like that ?? but good any way
Nope, because of MapAndreas finding the highest point on the coord you specify, then I filter them out with:

pawn Code:
if(z >= 5.0 && z < 30.0)
SKAzini is offline   Reply With Quote
Old 23/05/2014, 10:13 PM   #4
ZachKnoxx
Huge Clucker
 
Join Date: Oct 2013
Location: Canada
Posts: 200
Reputation: 70
Default Re: Totally random spawn positions

Good work.
ZachKnoxx is offline   Reply With Quote
Old 24/05/2014, 02:29 PM   #5
AroseKhanNiazi
High-roller
 
AroseKhanNiazi's Avatar
 
Join Date: Jan 2014
Location: Pakistan
Posts: 1,353
Reputation: 78
Default Re: Totally random spawn positions

Awesome then
AroseKhanNiazi is offline   Reply With Quote
Old 25/05/2014, 12:28 PM   #6
AviPeker
Big Clucker
 
AviPeker's Avatar
 
Join Date: Apr 2014
Location: Home :)
Posts: 87
Reputation: 9
Default Re: Totally random spawn positions

Nice
AviPeker is offline   Reply With Quote
Old 25/05/2014, 02:49 PM   #7
iRaiDeN
Huge Clucker
 
iRaiDeN's Avatar
 
Join Date: Mar 2014
Location: Israel
Posts: 483
Reputation: 41
Default Re: Totally random spawn positions

Nice & simple.
iRaiDeN is offline   Reply With Quote
Old 25/05/2014, 02:56 PM   #8
Parallex
Gangsta
 
Parallex's Avatar
 
Join Date: Mar 2014
Posts: 560
Reputation: 64
Default Re: Totally random spawn positions

This seems simple and nice, but it takes time. Good job.
Parallex is offline   Reply With Quote
Old 25/05/2014, 03:01 PM   #9
Patrick
Guest
 
Posts: n/a
Default Re: Totally random spawn positions

First I don't think this is really a filterscript, you could have posted it in Useful Function also why does it need to be a callback function, if it can be a stock function? also why are you using CallLocalFunction instead of Direct Calling (Speed test: http://forum.sa-mp.com/showpost.php?...&postcount=317)
  Reply With Quote
Old 25/05/2014, 06:10 PM   #10
SKAzini
Huge Clucker
 
SKAzini's Avatar
 
Join Date: Jun 2012
Posts: 376
Reputation: 17
Default Re: Totally random spawn positions

Quote:
Originally Posted by Patrick_ View Post
First I don't think this is really a filterscript, you could have posted it in Useful Function also why does it need to be a callback function, if it can be a stock function? also why are you using CallLocalFunction instead of Direct Calling (Speed test: http://forum.sa-mp.com/showpost.php?...&postcount=317)
I'm using CallRemoteFunction to call the filterscript function from the gamemode.
SKAzini is offline   Reply With Quote
Reply

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
Totally random OPcode? windimba Client Support 1 13/05/2014 02:04 PM
Zone & random positions iJumbo Scripting Help 3 28/11/2013 02:39 PM
Race Spawn Positions ]Rafaellos[ Scripting Help 6 30/09/2013 02:50 PM
Random spawn positions SkyWings Scripting Help 2 29/09/2012 11:17 AM
Script problems (Random Players, get positions) simstosh Help Archive 5 20/07/2010 06:26 AM


All times are GMT. The time now is 06:43 PM.


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