28.10.2014, 22:02
Код:
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;
}

