Givegun CMD Warning
#1

I got this CMD for /givegun and now i get this warning can anyone help

warning 202: number of arguments does not match definition in this line
""""""''strmid(giveplayer, PlayerRPName(playa), 0, MAX_PLAYER_NAME);"""""""""

pawn Код:
CMD:givegun(playerid, params[])
{
    new playa, gun;
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(!sscanf(params, "ui", playa, gun))
        {
            if(gun < 1||gun > 46) { SendClientMessage(playerid, COLOR_GRAD1, "   Invalid weaponid !"); return 1; }
            if(IsPlayerConnected(playa))
            {
                if(gun == 21)
                {
                    SetPlayerSpecialAction(playa,SPECIAL_ACTION_USEJETPACK);
                }
                GivePlayerAdminGun(playa, gun);
                strmid(giveplayer, PlayerRPName(playa), 0, MAX_PLAYER_NAME);
                format(string, sizeof(string), "   You have given gun %d to %s!", gun, giveplayer);
                SendClientMessage(playerid, COLOR_GREY, string);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_YELLOW,"_______________________________________");
            SendClientMessage(playerid, COLOR_WHITE, "1: Brass Knuckles 2: Golf Club 3: Nite Stick 4: Knife 5: Baseball Bat 6: Shovel 7: Pool Cue 8: Katana 9: Chainsaw");
            SendClientMessage(playerid, COLOR_WHITE, "10: Purple Dildo 11: Small White Vibrator 12: Large White Vibrator 13: Silver Vibrator 14: Flowers 15: Cane 16: Frag Grenade");
            SendClientMessage(playerid, COLOR_WHITE, "17: Tear Gas 18: Molotov Cocktail 19: Vehicle Missile 20: Hydra Flare 21: Jetpack 22: 9mm 23: Silenced 9mm 24: Deagle 25: Shotgun");
            SendClientMessage(playerid, COLOR_WHITE, "26: Sawnoff Shotgun 27: Combat Shotgun 28: Micro SMG (Mac 10) 29: SMG (MP5) 30: AK-47 31: M4 32: Tec9 33: Country Rifle");
            SendClientMessage(playerid, COLOR_WHITE, "34: Sniper Rifle 35: Rocket Launcher 36: HS Rocket Launcher 37: Flamethrower 38: Minigun 39: Satchel Charge");
            SendClientMessage(playerid, COLOR_WHITE, "40: Detonator 41: Spraycan 42: Fire Extinguisher 43: Camera 44: Nightvision Goggles 45: Infared Goggles 46: Parachute");
            SendClientMessage(playerid, COLOR_YELLOW,"_______________________________________");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
    }
    return 1;
}
Reply
#2

Is the warning from this line?
pawn Код:
GivePlayerAdminGun(playa, gun);
If so, post the above function or atleast the first line with its parameters. My guess is that it might need the ammo too, but without code - I can't be sure.
Reply
#3

Yes it's that line
Reply
#4

PHP код:
strmid(giveplayerPlayerRPName(playa), 0MAX_PLAYER_NAMEsizeof(giveplayer)); 
Reply
#5

Still the same warning
It says same warning but on this one
"GivePlayerAdminGun(playa, gun);"
Reply
#6

Show us that callback..
Reply
#7

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Show us that callback..
Yes, do that
Reply
#8

What do you mean callback
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)