SA-MP Forums Archive
/healall command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /healall command (/showthread.php?tid=173383)



/healall command - mrcoolballs - 02.09.2010

I tried to create my own /healall command which is only available for the owner to use, everything works okay except it only heals myself and not everyone else: BTW its in ZCMD

pawn Код:
CMD:healall(playerid,params[])
{
    if(Logged[playerid] == 0) return SendClientMessage(playerid,LIGHTBLUE,"You are not logged in");
    if(PlayerInfo[playerid][Owner] == 0 ) return SendClientMessage(playerid,LIGHTBLUE,"Only the owner can use this command");
    for (new i=0; i<MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            new str[51], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            format(str,sizeof(str),"Admin %s has healed you all!",name);
            SendClientMessage(i,LIMEGREEN,str);
            SetPlayerHealth(i,100);
            return 1;
        }
    }
    return 1;
}



Re: /healall command - Nero_3D - 02.09.2010

return stops the code and put the message out of the loop with SendClientMessageToAll


Re: /healall command - mrcoolballs - 02.09.2010

Okay so I just have to remove the first "remove 1;"?


Re: /healall command - WillyP - 02.09.2010

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
return stops the code and put the message out of the loop with SendClientMessageToAll
offtopic:

why you leave samp?


Re: /healall command - Nero_3D - 02.09.2010

Quote:
Originally Posted by mrcoolballs
Посмотреть сообщение
Okay so I just have to remove the first "remove 1;"?
Yes, with that it will work

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
offtopic:

why you leave samp?
If this refers to my sig, I only stopped playing