Weapon ID won't return
#2

pawn Код:
if(!strcmp("store", option, true))
{
    new option2[50], number, Float:Armor;
    if(sscanf(params, "s[30]s[30]", option, option2)) return SendClientMessage(playerid, COLOR_USAGE, "[USAGE:] /trunk store weapon | armor | money.");
    {
        if(!strcmp("weapon", option2, true))
        {
            if(GetPlayerScore(playerid) == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You need to be level 2 or above to use this.");
            if(GetPlayerWeapon(playerid) == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not holding a weapon.");
            new str[80], weapname[20];
            vInfo[vid][TrunkWeapon1] = GetPlayerWeapon(playerid);
            GetWeaponName(vInfo[vid][TrunkWeapon1], weapname, sizeof(weapname));
            format(str, sizeof(str), "stores %s in the trunk of the vehicle", weapname);
            return PlayerActionMsg(playerid, str);
        }
    }
}
GetWeaponName doesn't return the weapon name, but it stores it in the string you gave, so it stores in weapname. So, use weapname to show the weapon!

Edit: Just noticed. You are using strcmp before you even did sscanf, so I doubt this works.
Reply


Messages In This Thread
Weapon ID won't return - by Outcast - 08.01.2012, 07:51
Re: Weapon ID won't return - by Jochemd - 08.01.2012, 07:56
Re: Weapon ID won't return - by Outcast - 08.01.2012, 08:04
Re: Weapon ID won't return - by Jochemd - 08.01.2012, 08:16
Re: Weapon ID won't return - by Outcast - 08.01.2012, 08:20
Re: Weapon ID won't return - by Jochemd - 08.01.2012, 08:25
Re: Weapon ID won't return - by Outcast - 08.01.2012, 08:31
Re: Weapon ID won't return - by Jochemd - 08.01.2012, 08:31

Forum Jump:


Users browsing this thread: 1 Guest(s)