/healall command
#1

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;
}
Reply


Messages In This Thread
/healall command - by mrcoolballs - 02.09.2010, 12:50
Re: /healall command - by Nero_3D - 02.09.2010, 13:00
Re: /healall command - by mrcoolballs - 02.09.2010, 13:08
Re: /healall command - by WillyP - 02.09.2010, 13:19
Re: /healall command - by Nero_3D - 02.09.2010, 13:36

Forum Jump:


Users browsing this thread: 4 Guest(s)