Random Spawn in Minigame
#1

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;
}
Reply
#2

There's a nice little tutorial on this - https://sampforum.blast.hk/showthread.php?tid=162488

Use the search button next time.
Reply
#3

On top:

pawn Код:
new Minigames;
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.
Reply
#4

Thank you Pirvate200
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)