give gun command
#2

here you go

you need
pawn Код:
#include <sscanf2>
#include <zcmd>
pawn Код:
CMD:giveweapon(playerid, params[])
{
    new tmp[256];

    new lookupid, weapon, wname[64], ammo;
    if(IsPlayerAdmin(playerid))
    {
        if (sscanf(params, "uii",lookupid, weapon, ammo))
        return SendClientMessage(playerid, COLOR_YELLOW, "/givewepon <playerid> <gunid> <ammo>");

        if (!IsPlayerConnected(lookupid)) { return SendClientMessage(playerid, COLOR_YELLOW, "Player is not connected."); }

        if (weapon < 1 || weapon > 46)
        return SendClientMessage(playerid, COLOR_YELLOW, "Invalid weapon ID, valid id's are between 0 and 46");

        GivePlayerWeapon(lookupid, weapon, ammo);

        GetWeaponName(weapon, wname, 64);

        format(tmp, sizeof(tmp), "Admin %s (ID:%d) gave %s (ID:%d) a %s with %d ammo", GetName(playerid), playerid, GetName(lookupid), lookupid, wname, ammo);
        SendClientMessageToAll(COLOR_YELLOW, tmp);

        format(tmp, sizeof(tmp), "Admin %s (ID:%d) gave you a %s with %d ammo", GetName(playerid), playerid, wname, ammo);
        SendClientMessage(lookupid, COLOR_YELLOW, tmp);
    }
    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: 2 Guest(s)