SA-MP Forums Archive
Problem with string - 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: Problem with string (/showthread.php?tid=457604)



Problem with string - UnlimitedFreeroam - 12.08.2013

Hello Everyone,

I'm having a problem with a string that's not working on a weird way, hopefully someone can fix it for me.

pawn Код:
new Float:RandomSpawns[][] =
{
    {1443.7324,-2426.4797,15.7550,182.4360}, // Los Santos Airport
    {1474.8452,-2581.5078,13.5469,218.0661}, // Test spawn point
};
pawn Код:
public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1],RandomSpawns[rand][2]);
(No I haven't forgot to
pawn Код:
return 1;
}
at the end of the OnPlayerSpawn


Re: Problem with string - FiReAlEx - 12.08.2013

Do the code like this:
pawn Код:
new RandomSpawn = random(2);
switch(RandomSpawn){
case 0: //yourstuff
case 1: //your stuff}



Re: Problem with string - UnlimitedFreeroam - 12.08.2013

Ehm, that's useless if you're wanting more spawnpoints..


Re: Problem with string - FiReAlEx - 12.08.2013

You can change random's size.


Re: Problem with string - UnlimitedFreeroam - 12.08.2013

Fixed, nevermind