SA-MP Forums Archive
Need some help - 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: Need some help (/showthread.php?tid=590869)



Need some help - Tixxt - 04.10.2015

Hey guys,

Im trying to make a fs that makes players spawn on more then one place. I just cant get it to work... Can someone please make a script for me? I will repp so much and im willing to even pay via pp!

PLz let me know and help me!


Re: Need some help - d1git - 04.10.2015

What you could do is setup a timer and start it when the player connects. The timer would finish and trigger a function which would then pick a random spawn point, example;

PHP код:
stock randomEx(minmax)
{
    new 
rand random(max-min)+min;
    return 
rand;
}
SetTimerEx("RandomSpawnTimer"5000true"d"playerid);
forward RandomSpawnTimer(playerid);
public 
RandomSpawnTimer(playerid)
{
    new 
temp;
    
temp randomEx(15);
    switch(
temp)
    {
        case 
1SetPlayerPos(playeridxyz);
        case 
2SetPlayerPos(playeridxyz);
        case 
3SetPlayerPos(playeridxyz);
        case 
4SetPlayerPos(playeridxyz);
        case 
5SetPlayerPos(playeridxyz);
        
// Ect ect
    
}
    return 
1;