SA-MP Forums Archive
[FilterScript] Totally random spawn positions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Totally random spawn positions (/showthread.php?tid=514876)



Totally random spawn positions - SKAzini - 23.05.2014

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.



Re: Totally random spawn positions - AroseKhanNiazi - 23.05.2014

but will it some time spawn in air or water some thing like that ?? but good any way


Re: Totally random spawn positions - SKAzini - 23.05.2014

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)



Re: Totally random spawn positions - ZachKnoxx - 23.05.2014

Good work.


Re: Totally random spawn positions - AroseKhanNiazi - 24.05.2014

Awesome then


Re: Totally random spawn positions - AviPeker - 25.05.2014

Nice


Re: Totally random spawn positions - iRaiDeN - 25.05.2014

Nice & simple.


Re: Totally random spawn positions - Parallex - 25.05.2014

This seems simple and nice, but it takes time. Good job.


Re: Totally random spawn positions - Patrick - 25.05.2014

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)


Re: Totally random spawn positions - SKAzini - 25.05.2014

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.