/giveweapon help ;)
#1

Код:
CMD:giveweapon(playerid, params[])
{
    new id, gun, ammo, str[128], ID;
    if(pInfo[play0erid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR] "WHITE"You don't have sufficent permission to use this command!");
    if(sscanf(params,"uii", id, gun, ammo)) return SendClientMessage(playerid, COLOR_GREY, "[USAGE] "WHITE"/giveweapon [id/playername] [weapon id] [rounds]");
    if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "[ERROR] "WHITE"You have entered an invalid playername/playerid!");
    if(gun > 47 || gun < 1) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR] "WHITE"Invalid Weapon ID!");
    
    format(str, sizeof(str), "[SERVER] "WHITE"You have given %s(%d) a '%d' with '%d' rounds of ammo!", id, playerid, gun, ammo);
    SendClientMessage(playerid, COLOR_GREY, str);
    format(str, sizeof(str), "[ADMIN] "WHITE"%s(%d) has given you a '%d' with '%d' rounds of ammo!", PlayerName(playerid), playerid, gun, ammo);
    SendClientMessage(playerid, COLOR_LIME, str);
    
    GivePlayerWeapon(id, gun, ammo);
    return 1;
}
I'd like '%d' to provide the weapon name instead of the weapon id, and I'd like to be able to use the weapon ID or weapon name, when giving the weapon to the other player.
Reply


Messages In This Thread
/giveweapon help ;) - by RustyXD - 28.10.2014, 22:02
Respuesta: /giveweapon help ;) - by aoEXE - 28.10.2014, 22:12
Re: /giveweapon help ;) - by RustyXD - 28.10.2014, 22:20

Forum Jump:


Users browsing this thread: 3 Guest(s)