SA-MP Forums Archive
heal/armour all - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: heal/armour all (/showthread.php?tid=492183)



heal/armour all - Jese - 02.02.2014

Код:
CMD:healall(playerid, params[])
{
	new str[128];
	if(pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, COLOR_RED, "[Error]: You must be logged in!");
	if(pInfo[playerid][Admin] >= 4)
	{
		SendAdminCMD(playerid, "healall", 0);
	   	for(new i = 0; i < MAX_PLAYERS; i++)
  		{
			if(IsPlayerConnected(i) && (i != playerid) && (pInfo[playerid][Admin] > pInfo[i][Admin]) && InP[i] == 0 && InDM[i] == 0 && pInfo[i][Jail] == 0 && God[i][0] == 0 && God[i][1] == 0)
			{
				PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
				SetPlayerHealth(i, 100.0);
			}
		}
		PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
		format(str, sizeof(str), "Administrator %s(%d) has healed all players!", GetName(playerid), playerid);
		SendClientMessageToAll(COLOR_YELLOW, str);
	}
	else return SendClientMessage(playerid, COLOR_RED, EACMD);
	return 1;
}
Код:
CMD:armourall(playerid, params[])
{
	new str[128];
	if(pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, COLOR_RED, "[Error]: You must be logged in!");
	if(pInfo[playerid][Admin] >= 4)
	{
		SendAdminCMD(playerid, "armourall", 0);
	   	for(new i = 0; i < MAX_PLAYERS; i++)
  		{
			if(IsPlayerConnected(i) && (i != playerid) && (pInfo[playerid][Admin] > pInfo[i][Admin]) && InDM[i] == 0)
			{
				PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
				SetPlayerArmour(i, 100.0);
			}
		}
		PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
		format(str, sizeof(str), "Administrator %s(%d) has armoured all players!", GetName(playerid), playerid);
		SendClientMessageToAll(COLOR_YELLOW, str);
	}
	else return SendClientMessage(playerid, COLOR_RED, EACMD);
	return 1;
}
It plays player a sound but doesn't heal or armour them. halp?


Re: heal/armour all - GShock - 22.03.2014

You forgot to add
SetPlayerHealth(playerid, 100); in healall
and
SetPlayerArmour(playerid, 100.0); in armourall
?


Re: heal/armour all - MBilal - 22.03.2014

PHP код:
CMD:armourall(playerid,params[])
{
    if(
Player[playerid][pAdmin] >= 3)
    {
    new 
string[128];
    
format(string,sizeof(string),"Administrator %s Restore All Players Armour ",GetName(playerid));
      
SendClientMessageToAll(COLOR_ORANGEstring);
    for(new 
0MAX_PLAYERSi++)
    {
    
SetPlayerArmour(i,99);
    }
    }
    else
     {
     
SendClientMessage(playeridCOLOR_KRED"You need level 3 admin to use this cmd!");
      }
      return 
1;
}
CMD:healall(playerid,params[])
{
    if(
Player[playerid][pAdmin] >= 3)
    {
    new 
string[128];
    
format(string,sizeof(string),"Administrator %s Restores All Players Health ",GetName(playerid));
      
SendClientMessageToAll(COLOR_ORANGEstring);
    for(new 
0MAX_PLAYERSi++)
    {
    
SetPlayerHealth(i,99);
    }
    }
    else
     {
     
SendClientMessage(playeridCOLOR_KRED"You need level 3 admin to use this cmd!");
      }
      return 
1;

try this it working fine for me between why you want not to heal playerid and also not heal higher admins ?