SA-MP Forums Archive
A lil help - 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: A lil help (/showthread.php?tid=219917)



A lil help - TheAlienForce - 02.02.2011

Like with the code below, it said "AK-47 time and it gave me sawn-offs.
i want it to say the name of the weapon it tells me.
I have a new aweaponnames.. on the top of my script so dont ask me if i have it. The anwser is yes.
pawn Код:
public GiveRandomWeapon(playerid)
{
    new r,string[128];
    do
    {
        r = random(39);
    }
    while(r == 0 || r == 19 || r == 20 || r == 21 || r == 37 || r == 38);
    GivePlayerWeapon(playerid, r, 500);
    format(string, sizeof(string), "~w~%s ~r~time!",aWeaponnames[(r)]);
    GameTextForAll(string, 3000, 3);
    return 1;
}



Re: A lil help - admantis - 02.02.2011

you could probably have mixed up ids


Re: A lil help - Mauzen - 02.02.2011

Maybe your aWeaponnames has just a wrong order, or you left out some names. Ak-47 has to have the index 30 for example.


Re: A lil help - TheAlienForce - 02.02.2011

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Maybe your aWeaponnames has just a wrong order, or you left out some names. Ak-47 has to have the index 30 for example.
Made it my self:
pawn Код:
new aWeaponnames[33][] =
{
    {"Brass knuckles"},
    {"Golf club"},
    {"Nite stick"},
    {"Knife"},
    {"Baseball bat"},
    {"Shovel"},
    {"Pool cue"},
    {"Kantana"},
    {"Chainsaw"},
    {"Purple dildo"},
    {"Short vibrator"},
    {"Long vibrato"},
    {"White dildo"},
    {"Flowers"},
    {"Cane"},
    {"Grenades"},
    {"Tear gas"},
    {"Molotov cocktail"},
    {"9mm Pistol"},
    {"Silenced pistol"},
    {"Desert eagle"},
    {"Shotgun"},
    {"Sawn-off shotgun"},
    {"Combat shotgun"},
    {"Micro Uzi"},
    {"Mp5"},
    {"Ak47"},
    {"M4"},
    {"Tec 9"},
    {"Country rifle"},
    {"Sniper rifle"},
    {"Rpg"},
    {"Heat seeking rocket"}
};