Health Zone - 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)
+--- Thread: Health Zone (
/showthread.php?tid=355931)
Health Zone -
farCry.xD - 01.07.2012
Hey , how can I make , a zone, and when a player type /health .. to give it health ?
Re: Health Zone -
WagnerPM - 01.07.2012
pawn Код:
SetPlayerHealth(playerid, 100);
Re: Health Zone -
farCry.xD - 01.07.2012
I know this , I want to know how to create a zone , and when a player tip /lala , to give he HEALTH .. A ZONE
Respuesta: Health Zone -
[DOG]irinel1996 - 01.07.2012
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.
Re: Health Zone -
WagnerPM - 01.07.2012
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
Re: Health Zone -
farCry.xD - 01.07.2012
Oh ,thank you man , I will be back with a Edit if it work's
EDIT: Thank's to all , it work's :X