/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
#2

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

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

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?
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)