Random weapons
#1

Solved
Reply
#2

pawn Код:
new i = random(5);
GivePlayerWeapon(playerid, i, 999999); something like that?

-----------
or

switch(random(5))
{
    case 0: giveweapon(playerid, 1, 99999);
    case 1:....
    ......
    ......
    ......
}
Reply
#3

You will want more checks but basically this is it.
pawn Код:
if(checkpointid == RandomWeaponCP)
{
    new randwep = random(41);
    ResetPlayerWeapon(playerid);

    switch(randwep)
    {
        case 0:
        {
        }
    }
}
EDIT: Too slow.
Reply
#4

Solved
Reply
#5

ResetPlayerWeapons it should be, and you need opening and closing braces for cases. Also dont forget case 0. It should be case 0 to 6 with your code.
pawn Код:
case 1: {GivePlayerWeapon(playerid,AK,500); GameTextForPlayer(playerid,"~r~ YOU GOT A RANDOM WEAPON OF ~n~~w~AK47 ASSUALT RIFLE",6000,4);}
EDIT: don't use "random(40)" with your code use "random(7)". I thought you wanted a complete random weapon (all weapons included) using the result of random for the id of the weapon.
Reply
#6

Solved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)