PHP код:
CMD:eweapon(playerid, params[])
{
new world = GetPlayerVirtualWorld(playerid);
if(world != 0)
{
if(PInfo[playerid][Level] >= 1) {
new id, gun, ammo;
if(sscanf(params,"uii", id, gun, ammo)) return SendClientMessage(playerid, -1,"USAGE: /givegun [playerid/partofname] [gunid] [ammo]");
if(gun > 47 || gun < 1) return SendClientMessage(playerid, -1,"GUN ID'S: 1-47");
if(ammo > 15000 || ammo < 1) return SendClientMessage(playerid, -1,"Ammo 1-15000");
GivePlayerWeapon(id, gun, ammo);
}
else //if he has not got the permissions
{
SendClientMessage(playerid, COLOR_RED, "You are not admin level 3."); //return this message
}
return 1;
}
}
instead for giving one player only.
Loop through all players which are in the virtualworld and give them then the weapons.