12.03.2015, 15:57
Hello everyone.
When i use this command (below), Only i get the weapon i write, But others don't get..
Can someone tell me why and fix it please?
The command:
When i use this command (below), Only i get the weapon i write, But others don't get..
Can someone tell me why and fix it please?
The command:
PHP Code:
CMD:giveweaponall(playerid,params[])
{
#pragma unused params
new string[128];
new Ammo;
new Wepid;
new ID;
if(AdminLevel[playerid] < 4) return SendClientMessage(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the the right admin level for this command.");
if(sscanf(params,"ii",Wepid,Ammo))
{
SendClientMessage(playerid,COLOR_WHITE,""COL_USAGE"[SYNTAX] {FFFFFF}/giveweaponall [WEAPON_ID] [AMMO]");
return 1;
}
if(!IsValidWeapon(Wepid)) return SendClientMessage(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}Invalid weapon ID. Please enter a weapon ID between <1-18> || <22-46>.");
if(AdminLevel[playerid] < 5)
{
if(Wepid == 38) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}This weapon is not allowed in this command.");
if(Wepid == 45) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}This weapon is not allowed in this command.");
if(Wepid == 44) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}This weapon is not allowed in this command.");
if(Wepid == 39) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}This weapon is not allowed in this command.");
if(Wepid == 40) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}This weapon is not allowed in this command.");
if(Wepid == 36) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}This weapon is not allowed in this command.");
}
for(new i = 0; i<MAX_PLAYERS;i++)
{
if(JailTime[i] == 0)
{
GivePlayerWeapon(i,Wepid,Ammo);
}
format(string,sizeof(string),""COL_ADMIN"[ADMIN] {FFFFFF}All players have been given a %s from %s(%d)!",aWeaponNames[Wepid],PlayerName(playerid),ID);
SendClientMessageToAll(COLOR_WHITE,string);
format(string,sizeof(string),"%s(%d) has given all players a %s",PlayerName(playerid),playerid,aWeaponNames[Wepid]);
SendPROMessage(string);
return 1;
}
return 1;
}