Help with Random Weapons
#2

Wrote a quick func for you not tested should work.

pawn Код:
stock GiveRandomWeapon(playerid)
{

    new rand_weapon = random( 42 );
   
    switch( rand_weapon )
    {
   
        case 0, 19, 20, 21://invalid ids, or unarmed. Add any weaponids you don't want here
        {
       
            rand_weapon = 22;//9mm change if you want
            GivePlayerWeapon( playerid, rand_weapon, 1000 );
        }
       
        default:
        {
            GivePlayerWeapon( playerid, rand_weapon, 1000 ); //or also create random ammo amt
        }
   
    }

}
EDIT: I also forgot to add satchel charges to invalid weapon case, IIRC they are not synced.
Reply


Messages In This Thread
Help with Random Weapons - by James Coral - 29.04.2012, 09:10
Re: Help with Random Weapons - by iggy1 - 29.04.2012, 09:19
Re: Help with Random Weapons - by $$inSane - 29.04.2012, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)