Random Spawn in Minigame - 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 in Minigame (
/showthread.php?tid=436032)
Random Spawn in Minigame -
AwokenNeoX - 09.05.2013
Hi I have make a Minigame this is the Command. But if I use this Commmands I only spawn at the same place how can I spawn random?
Код:
CMD:mg3(playerid, params[])
{
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid,2220,1570,1001);
SetPlayerPos(playerid,2205,1579,1001);
SetPlayerPos(playerid,2169,1572,1001);
SetPlayerPos(playerid,2194,1627,1001);
SetPlayerPos(playerid,2218,1614,1001);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 38, 9999); //38 = Minigun
SendClientMessage(playerid,COLOR_YELLOW,"Welcome to Minigame Minigun");
return 1;
}
Re: Random Spawn in Minigame -
KingHual - 09.05.2013
There's a nice little tutorial on this -
https://sampforum.blast.hk/showthread.php?tid=162488
Use the search button next time.
Re: Random Spawn in Minigame -
Private200 - 09.05.2013
On top:
pawn Код:
CMD:mg3(playerid, params[])
{
SetPlayerInterior(playerid, 1);
Minigames = random(5);
switch(Minigames)
{
case 0: SetPlayerPos(playerid,2220,1570,1001);
case 1: SetPlayerPos(playerid,2205,1579,1001);
case 2: SetPlayerPos(playerid,2169,1572,1001);
case 3: SetPlayerPos(playerid,2194,1627,1001);
case 4: SetPlayerPos(playerid,2218,1614,1001);
}
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 38, 9999); //38 = Minigun
SendClientMessage(playerid,COLOR_YELLOW,"Welcome to Minigame Minigun");
return 1;
}
That shall be fine.
AW: Random Spawn in Minigame -
AwokenNeoX - 09.05.2013
Thank you Pirvate200