help me :(
#1

this dosnt give the selected number in new weaps... i mean it does
but it gives like aswell weapons that arnt listed.
pawn Код:
public GiveRandomWeapon(playerid)
{
    new weaps[][] =
    {
        5,
        6,
        23,
        24,
        29,
        31,
        33,
        42
    };
    new r,string[128],weapname[32];
    r = random(sizeof(weaps));
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        ResetPlayerWeapons(i);
        GivePlayerWeapon(i, r, 500);
    }
    GetWeaponName(r,weapname,sizeof(weapname));
    format(string, sizeof(string), "~g~%s ~w~time!",weapname);
    GameTextForAll(string, 3000, 3);
    return 1;
}
Reply
#2

pawn Код:
public GiveRandomWeapon(playerid)
{
    new weaps[] =
    {
        5,
        6,
        23,
        24,
        29,
        31,
        33,
        42
    };
    new r,string[128],weapname[32];
    r = random(sizeof(weaps));
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        ResetPlayerWeapons(i);
        GivePlayerWeapon(i, weaps[r], 500);
    }
    GetWeaponName(weaps[r],weapname,sizeof(weapname));
    format(string, sizeof(string), "~g~%s ~w~time!",weapname);
    GameTextForAll(string, 3000, 3);
    return 1;
}
use weaps[r] , instead of just r in this case
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)