what's wrong ?
#1

What's wrong with this command ?

Код:
CMD:givegun(playerid, params[])
{
        new string[128], target, gun;
        if(APlayerData[playerid][PlayerLevel] >= 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
        if(sscanf(params, "ud", target, gun)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /givegun <playerid> <gun>");
        if(gun < 1 || gun > 47) return SendClientMessage(playerid, COLOR_GREY, "Don't go below 1 or above 47.");
        if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_GREY, "User is not connected!");
        if(gun != 21)
        {
             GivePlayerWeapon(target, gun, 50000); //Your version would be GivePlayerValidWeapon, this also may be causing issues.
             format(string, sizeof(string), "Admin %s has given you a weapon.", PlayerName(playerid));
             SendClientMessage(target, COLOR_YELLOW, string);
             format(string, sizeof(string), "You have given %s a weapon.", PlayerName(target));
             SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        return 1;
}
Errors :

Код:
(13824) : error 012: invalid function call, not a valid address
(13824) : warning 215: expression has no effect
(13824) : error 001: expected token: ";", but found ")"
(13824) : error 029: invalid expression, assumed zero
(13824) : fatal error 107: too many error messages on one line
Reply


Messages In This Thread
what's wrong ? - by Jhony_Blaze - 16.12.2014, 14:51
Re: what's wrong ? - by Eth - 16.12.2014, 14:55
Re: what's wrong ? - by NoDi522 - 16.12.2014, 15:03
Re: what's wrong ? - by Jhony_Blaze - 16.12.2014, 15:14
Re: what's wrong ? - by UltraScripter - 16.12.2014, 15:21
Re: what's wrong ? - by Threshold - 16.12.2014, 15:27
Re: what's wrong ? - by Jhony_Blaze - 16.12.2014, 15:41
Re: what's wrong ? - by Threshold - 16.12.2014, 15:46
Re: what's wrong ? - by Jhony_Blaze - 16.12.2014, 16:52

Forum Jump:


Users browsing this thread: 2 Guest(s)