SA-MP Forums Archive
Help whit /heal command....How to check yourself - 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: Help whit /heal command....How to check yourself (/showthread.php?tid=140377)



Help whit /heal command....How to check yourself - DarkPower - 08.04.2010

i made simple /heal command and idk how to make when i am medic i can heal myself how i can block that, i wont to can heal myself HERE IS COMMAND

pawn Код:
dcmd_heal(playerid, params[])
{
        if(lije1[playerid] == 0 ) return SendClientMessage(playerid ,0xFF0000FF, "Moras biti zaposlen kao lijecnik kako bi mogao lijeciti ljude!");
        new id,optional[16],health;
        if (sscanf(params, "uz", id,optional))
        {
            SendClientMessage(playerid,0xFFB400FF, "Napisi: /Heal ID/Nick Helta: (1-100)");
        }
        else if (id == INVALID_PLAYER_ID)
        {
            new string[256];
            format(string,sizeof(string),"Igrac nije pronaden");
            SendClientMessage(playerid,0xFFB400FF,string);
            return 1;
        }
        else
        {
            if (sscanf(optional,"d",health))
            {
              health=90;
            }
            new Float:X,Float:Y,Float:Z,Float:InRange;
            GetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
            InRange=IsPlayerInRangeOfPoint(id,24-(lije1[playerid] == 1 ),X,Y,Z);
            if (InRange>0)
            {
           
                  new Float:health2;
                  GetPlayerHealth(playerid,health2);
                  if (health2 > 95) return SendClientMessage(playerid, 0xFF0005FF, "Taj igrac ima preko >| 95 POSTO |< helti!");
                SetPlayerHealth(id,health);
                 new Name[MAX_PLAYER_NAME];
                GetPlayerName(playerid,Name,sizeof(Name));
                new string[256];
                format(string,sizeof(string),"[%d] %s te izljecio na %d\%",playerid,Name,health);
                SendClientMessage(id,0xFFB400FF,string);
                GetPlayerName(id,Name,sizeof(Name));
                format(string,sizeof(string),"izljecio si [%d] %s na %d\"",id,Name,health);
                SendClientMessage(playerid,0xFFB400FF,string);
                GivePlayerMoney(playerid,1000);
            }
        }
        return 1;
    }



Re: Help whit /heal command....How to check yourself - dice7 - 08.04.2010

pawn Код:
if (id == playerid) return SendClientMessage(playerid, color, "Can't heal yourself");



Re: Help whit /heal command....How to check yourself - DarkPower - 08.04.2010

tny.... today i learn something tny again


Re: Help whit /heal command....How to check yourself - johnathon956 - 08.04.2010

this is way more simple
pawn Код:
if(!strcmp(cmdtext, "/heal", true))
    {
    SetPlayerHealth(playerid,100);
    return 1;



Re: Help whit /heal command....How to check yourself - DarkPower - 08.04.2010

Quote:
Originally Posted by johnathon956
this is way more simple
pawn Код:
if(!strcmp(cmdtext, "/heal", true))
    {
    SetPlayerHealth(playerid,100);
    return 1;
lol i made command who will heal other players....Whit radius and i define player job = medic....I wont to type /heal and to my health get on >| 100 |< i know you put !


Re: Help whit /heal command....How to check yourself - johnathon956 - 08.04.2010

Quote:
Originally Posted by [EFS
]
Quote:
Originally Posted by johnathon956
this is way more simple
pawn Код:
if(!strcmp(cmdtext, "/heal", true))
    {
    SetPlayerHealth(playerid,100);
    return 1;
lol i made command who will heal other players....Whit radius and i define player job = medic....I wont to type /heal and to my health get on >| 100 |< i know you put !
ahh sorry