Command /heal help
#1

Ok so I have /heal in my GM. Currently the person has to set the players health (/heal [playerid/PartOfName] [health]), I would like it to always be set to 100. How do I edit it so it is always 100?

Please include exactly what to replace, as I am newer to this type of thing.

Thanks,
jakejohnsonusa


**Note that nothing important is cut off, I just made sure to include the healing cmd label**
Command:
pawn Код:
else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal [playerid/PartOfName]");
                    return 1;
                }
            }
            if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//model
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal[playerid/PartOfName] [health]");
                    return 1;
                }
                new playa;
                new health;
                playa = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                health = strval(tmp);
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        SetPlayerHealth(playa, health);
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        format(string, 256, "You Have Healed %s!.", giveplayer,playa,health);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                        format(string, sizeof(string), "Medic %s Has Healed you!",sendername, health);
                        SendClientMessage(playa, TEAM_GROVE_COLOR, string);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "** you are not authorized to use that command!");
                }
            }
        }
Reply
#2

pawn Код:
else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal [playerid/PartOfName]");
                    return 1;
                }
            }
            if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//model
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal[playerid/PartOfName]");
                    return 1;
                }
                new playa;
                playa = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        SetPlayerHealth(playa, 100);
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        format(string, 256, "You Have Healed!", giveplayer,playa);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                        format(string, sizeof(string), "Medic %s Has Healed you!",sendername);
                        SendClientMessage(playa, TEAM_GROVE_COLOR, string);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "** you are not authorized to use that command!");
                }
            }
        }
just remove a few line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)