30.01.2015, 13:55
pawn Код:
CMD:giveallweapon(playerid, params[])
{
new Weapon, Ammo, string[144], name[MAX_PLAYER_NAME], WeaponName[30];
GetPlayerName(playerid, name, sizeof(name));
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}You aren't authorized to use this command.");
if(sscanf(params, "ii", Weapon, Ammo)) return SendClientMessage(playerid, -1, "{FF0000}USAGE: {FFFFFF}/GiveAllWeapon [Weapon ID] [Ammo]");
if(Weapon > 46) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}Invalid Weapon. [1-46]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GivePlayerWeapon(i, Weapon, Ammo);
}
}
GetWeaponName(Weapon, WeaponName, sizeof(WeaponName));
format(string, sizeof(string), "{FF0000}[WEAPONS]: {FFFFFF}Administrator {FF0000}%s {FFFFFF}has gave to all players a {FF0000}%s (%i) with %i ammo.", name, WeaponName, Weapon, Ammo);
SendClientMessageToAll(-1, string);
return 1;
}

