Spawn randomly - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawn randomly (
/showthread.php?tid=143416)
Spawn randomly -
ViruZZzZ_ChiLLL - 22.04.2010
Okay, so lets say that when the player types /grove
Код:
if (!strcmp("/grove",cmdtext,true))
{
SetPlayerPos(playerid, 2498, -1666, 14);
return 1;
}
He will teleport to the that postion.
Problem:
How can I make the player spawn randomly around the grove street?
________
Stocks to buy now
Re: Spawn randomly -
Nero_3D - 22.04.2010
Get more cords and do something like that
pawn Код:
if (!strcmp("/grove",cmdtext,true))
{
switch(random(4)) //4 is the number of positions
{
case 0: SetPlayerPos(playerid, 2498, -1666, 14);
case 1: SetPlayerPos(playerid, 2498, -1666, 14);
case 2: SetPlayerPos(playerid, 2498, -1666, 14);
case 3: SetPlayerPos(playerid, 2498, -1666, 14);
}
return 1;
}
Re: Spawn randomly -
ViruZZzZ_ChiLLL - 22.04.2010
Quote:
Originally Posted by ? Joker ?
Get more cords and do something like that
pawn Код:
if (!strcmp("/grove",cmdtext,true)) { switch(random(4)) //4 is the number of positions { case 0: SetPlayerPos(playerid, 2498, -1666, 14); case 1: SetPlayerPos(playerid, 2498, -1666, 14); case 2: SetPlayerPos(playerid, 2498, -1666, 14); case 3: SetPlayerPos(playerid, 2498, -1666, 14); }
return 1; }
|
Okay, thank you very much
________
BUY EXTREME VAPORIZER