30.01.2015, 13:47
PHP код:
CMD:giveallweapon(playerid,params[]) {
if(pInfo[playerid][pLevel] >= 4) {
new Weap, ammo, weaponname[50] , string[128];
if(sscanf(params,"ii",Weap, ammo)) return SendClientMessage(playerid,red,"Usage: /giveallweapon [weapon name] [ammo]");
if(Weap == 38 || Weap == 36) return SendClientMessage(playerid,red,"You are not allowed to give these weapons");
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i))
{
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
}
}
GetWeaponName(Weap, weaponname, sizeof(weaponname));
format(string,sizeof(string),"Administrator %s has given all players weapon %s (%d) with %d round of ammo.",GetName(playerid),weaponname,Weap,ammo);
SendClientMessageToAll(blue,string);
}
else SendClientMessage(playerid,red,"You are not a high enough level to use this command");
return 1;
}