Random spawn object - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random spawn object (
/showthread.php?tid=639943)
Random spawn object -
Maker52130 - 25.08.2017
Hello guys, im new scripteur (writer) and i need help.
I have started scripting a server and I am looking for spawn objects at different locations with a timer.
Do as a random spawn for a character except with an object. I can not find any tutorials. Sorry for my bad english im french, good afternoon !
Re: Random spawn object -
10MIN - 25.08.2017
Hmmm, maybe this can help you?:
Код:
//After the last #include
#define CreateRandomObject() CreateObject(random(3399), RandomFloat(), RandomFloat(), RandomFloat(), RandomFloat(), RandomFloat(), RandomFloat())
//At the bottom of the script
Float:RandomFloat()
{
new Float:rand = random() \ (random() % random() )
return rand;
}
How to use it? Use
CreateRandomObject() to spawn a random object in a random place in the map.
Hope I helped you. Or in french: "J'espиre que je t'ai aidй".
Re: Random spawn object -
Maker52130 - 25.08.2017
I go test this tonight , thanks for your fast reply. I'll tell you if it works tonight, thanks you very much.