SA-MP Forums Archive
Not working :/ - 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: Not working :/ (/showthread.php?tid=219880)



Not working :/ - TheAlienForce - 02.02.2011

id 37 is flame thrower
and if 38 is the minigun
and it still gives them and i dont want it too
pawn Код:
public GiveRandomWeapon(playerid)
{
    new rand = random(39);
    if(rand == 0 || rand == 19 || rand == 20 || rand == 21 || rand == 37 || rand == 38)
    {
        random(39);
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GivePlayerWeapon(i,rand,500);
    }
    return 1;
}



Re: Not working :/ - [MWR]Blood - 02.02.2011

I didn't get you.
You don't want to give any weapons, or what?


Re: Not working :/ - TheAlienForce - 02.02.2011

Quote:
Originally Posted by Delux13
Посмотреть сообщение
I didn't get you.
You don't want to give any weapons, or what?
Quote:
Originally Posted by Delux13
Посмотреть сообщение
I didn't get you.
You don't want to give any weapons, or what?
i want to it to give weapons but exept the ones selected like:
pawn Код:
if(rand == 0 || rand == 19 || rand == 20 || rand == 21 || rand == 37 || rand == 38)
i dont want the random to choose those, look again at the code...


Re: Not working :/ - hadzx - 02.02.2011

so you want it to give them a random weapons but only the ids youve listed?


Re: Not working :/ - TheAlienForce - 02.02.2011

Quote:
Originally Posted by hadzx
Посмотреть сообщение
so you want it to give them a random weapons but only the ids youve listed?
-.-!!! No i want to give weapons, but exept the one's listed because they are the minigun + flame thrower and undefined id's..


Re: Not working :/ - Vince - 02.02.2011

pawn Код:
new
    r;

do
{
    r = random(39);
}
while(r == 0 || r == 19 || r == 20 || r == 21 || r == 37 || r == 38);

GivePlayerWeapon(playerid, r, 500);



Re: Not working :/ - TouR - 02.02.2011

pawn Код:
public GiveRandomWeapon(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    new rand = random(39);
    if(rand != 0 && rand != 19 && rand != 20 && rand != 21 || rand != 37 && rand != 38)
    {
             GivePlayerWeapon(i,rand,500);
     }
     else
     {
            GiveRandomWeapon(i);
    }
  }
    return 1;
}
try this


Re: Not working :/ - hadzx - 02.02.2011

edit : sorry error 94