Health Zone
#1

Hey , how can I make , a zone, and when a player type /health .. to give it health ?
Reply
#2

pawn Код:
SetPlayerHealth(playerid, 100);
Reply
#3

I know this , I want to know how to create a zone , and when a player tip /lala , to give he HEALTH .. A ZONE
Reply
#4

You have to check your position first, you should read this https://sampwiki.blast.hk/wiki/Areacheck.
Now,
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/healme", true))
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        if (Pos[0] <= SavedX && Pos[0] >= SavedX && Pos[1] <= SavedY && Pos[1] >= SavedY)
        {
            SetPlayerHealth(playerid,100.0);
        } else SendClientMessage(playerid,"You're not in YOUR AREA, sorry!");
    }
    return 0;
}
I hope you understand me.

Best regards!

_____________________
EDIT:

@WagnerPM: you made it so easy now.
Reply
#5

Sorry.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0, CorX, CorY, CorZ))
{
    SetPlayerHealth(playerid, 100);
}
More info
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

@Edit
irinel1996 posted together
Reply
#6

Oh ,thank you man , I will be back with a Edit if it work's

EDIT: Thank's to all , it work's :X
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)