give gun command
#5

pawn Код:
CMD:givegun(playerid, params[])
{
        if(PlayerInfo[playerid][pAdmin] < 3) 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.", GetName(playerid));
             SendClientMessage(target, COLOR_GREY, string);
             format(string, sizeof(string), "You have given %s a weapon.", GetName(target));
             SendClientMessage(playerid, COLOR_GREY, string);
        }
        return 1;
}
Reply


Messages In This Thread
give gun command - by Jhony_Blaze - 15.12.2014, 19:09
Re: give gun command - by JeaSon - 15.12.2014, 19:23
Re: give gun command - by Jhony_Blaze - 15.12.2014, 19:41
Re: give gun command - by JeaSon - 15.12.2014, 19:50
Re: give gun command - by Clad - 15.12.2014, 19:52
Re: give gun command - by Jhony_Blaze - 15.12.2014, 19:58
Re: give gun command - by Jhony_Blaze - 15.12.2014, 20:01
Re: give gun command - by JeaSon - 15.12.2014, 20:09
Re: give gun command - by Clad - 15.12.2014, 20:17

Forum Jump:


Users browsing this thread: 1 Guest(s)