Medic Command
#1

When the player do /heal and his ID he can heal himself how to disable that?

pawn Код:
new index;
    cmd = strtok(cmdtext, index);
    if (strcmp(cmd, "/heal", true) == 0)
    {
        if( gPlayerClass[playerid] != MEDIC ) return SendClientMessage(playerid, COLOR_RED, "You are not a Medic!");
        new id;
        tmp = strtok(cmdtext, index);
        if (strlen(tmp))
        {
            id = strval(tmp);
            if (IsPlayerConnected(id))
            {
                if(healedrec[playerid] != 1)
                {
                    new Float:gX, Float:gY, Float:gZ;
                    GetPlayerPos(id, gX, gY, gZ);
                    if( IsPlayerInRangeOfPoint(playerid, 5.0, gX, gY, gZ) )
                    {
                        SetPlayerHealth(id, 99.0);
                        SendClientMessage(id, 0x00FF00AA, "You've been healed by a medic!");
                        SendClientMessage(playerid, 0x00FF00AA, "Player healed.");
                        SendClientMessage(playerid, COLOR_RED, "You may heal again in 15 seconds.");
                        healedrec[playerid] = 1;
                        SetTimerEx("HealAgain", 15000, 0, "i", playerid);
                    }else SendClientMessage(playerid, COLOR_RED, "You need to be near the player to heal him !");
                }
                else
                {
                    SendClientMessage(playerid, 0xFF0000AA, "You have healed a player recently!");
                }
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "Player not found");
            }
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "USAGE: /heal <id>");
        }
        return 1;
    }
Reply


Messages In This Thread
Medic Command - by Alex_Obando - 08.08.2011, 20:11
Re: Medic Command - by Scarred - 08.08.2011, 20:14
Re: Medic Command - by wouter0100 - 08.08.2011, 20:14
Respuesta: Medic Command - by Alex_Obando - 08.08.2011, 20:15
Re: Medic Command - by Scarred - 08.08.2011, 20:16
Re: Medic Command - by wouter0100 - 08.08.2011, 20:17
Re : Medic Command - by Soumi - 08.08.2011, 20:22
Respuesta: Medic Command - by Alex_Obando - 08.08.2011, 20:56

Forum Jump:


Users browsing this thread: 1 Guest(s)