05.08.2018, 20:07
Hi I've creating a command for admins. but when I type /giveallweapon then type the Weapon ID + Ammo They are sending only the message but they did not give the players a weapon why?
PHP код:
CMD:giveallweapon(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3 && 5)
{
new string[256],weaponid,ammo;
new weaponName[32];
if(sscanf(params, "uii", weaponid, ammo)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /giveallweapon [Weapon ID] [Amount of Ammo]");
{
if(PlayerInfo[playerid][pAdmin] <= 1 && 2) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}This command for admins +level 2.");
GetWeaponName(weaponid, weaponName, sizeof weaponName);
GivePlayerWeapon(playerid, weaponid, ammo);
format(string,sizeof(string),"{A82FED}[Weapon Given]: {FFFFFF}An Admin {A82FED}%s(%d) {FFFFFF}has given All players a {A82FED}%s {FFFFFF}with {A82FED}%d {FFFFFF}rounds of Ammo.", PlayerName(playerid), playerid, weaponName, ammo);
SendClientMessageToAll(COLOR_ORANGE,string);
format(string, sizeof(string), "An Admin %s(%d) has Giving All players a %s with %d rounds of Ammo. (/giveallweapon)!", PlayerName(playerid), playerid, weaponName,ammo);
SendToAdmins(COLOR_GREY,string);
}
}
else
SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`.");
return 1;
}