SA-MP Forums Archive
Healall cmd wont work [FAST +rep ] - 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: Healall cmd wont work [FAST +rep ] (/showthread.php?tid=585526)



Healall cmd wont work [FAST +rep ] - Toxik - 14.08.2015

So the problem is
the admin who use the cmd dont got healed
pawn Код:
[COLOR="Red"]here is the code[/COLOR]
dcmd_healall(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 3)
    {
        SendCommandToAdmins(playerid,"HealAll");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) && (i != playerid) && i != ServerInfo[MaxAdminLevel])
        {
        PlayerPlaySound(i,1057,0.0,0.0,0.0);
        SetPlayerHealth(i,100.0);
        }
        }
        new string[128];
        format(string,sizeof(string),"|- Administrator \"%s\" has Healed all players -|", pName(playerid));
        return SendClientMessageToAll(blue, string);
    }
    else return ErrorMessages(playerid, 6);
}



Re: Healall cmd wont work [FAST +rep ] - Dziugsas - 14.08.2015

Try deleting "&& i != ServerInfo[MaxAdminLevel]"


Re: Healall cmd wont work [FAST +rep ] - Toxik - 14.08.2015

Nope. not working your method
btw i fixed it


Re: Healall cmd wont work [FAST +rep ] - iTakelot - 14.08.2015

try:
PHP код:
dcmd_healall(playerid,params[])
{
    
#pragma unused params
    
if(AccInfo[playerid][Level] >= 3)
    {
        
SendCommandToAdmins(playerid,"HealAll");
           for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i)
            {
                if(
ServerInfo[MaxAdminLevel](i)
                {
                    
PlayerPlaySound(i,1057,0.0,0.0,0.0);
                    
SetPlayerHealth(i,100.0);
                }
            }
        }
        new 
string[128];
        
format(string,sizeof(string),"|- Administrator \"%s\" has Healed all players -|"pName(playerid));
        return 
SendClientMessageToAll(bluestring);
    }
    else return 
ErrorMessages(playerid6);




Re: Healall cmd wont work [FAST +rep ] - Toxik - 14.08.2015

Like i said up i fixed it