Armour Regeneration Scripting Help - 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: Armour Regeneration Scripting Help (
/showthread.php?tid=554840)
Armour Regeneration Scripting Help -
LMaxCo - 05.01.2015
Hi All,
Armour Regeneration This Very Simple

Im Use ZCMD To Create This Armour Regeneration
Код:
CMD:hm(playerid,params[]){
if(GetPlayerPos(playerid),X,Y,Z)
return SendClientMessage(playerid,-1,"You are not in the position to get Armour Regeneration!");
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
return 1;
}
Re: Armour Regeneration Scripting Help -
M4D - 05.01.2015
GetPlayerPos will return player position. you have to use IsPlayerInRangeOfPoint function to check if player is in range of a position or no.
See wiki
Re: Armour Regeneration Scripting Help -
ATGOggy - 05.01.2015
This is not the right way. You can't use GetPlayerPos in if as it returns only success and failures.
Fixed code is:
PHP код:
CMD:hm(playerid,params[]){
if(!IsPlayerInRangeOfPoint(................blah....blah....)) return SendClientMessage(playerid,-1,"You are not in the position to get Armour Regeneration!");
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
return 1;
}
IsPlayerInRangeOfPoint:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: Armour Regeneration Scripting Help -
Banana_Ghost - 05.01.2015
pawn Код:
CMD:hm(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid,10.0,0.00,0.00,0.00)) return SendClientMessage(playerid,-1,"You are not in the position to get Armour Regeneration!");
else
{
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
}
return 1;
}
replace 10.0 with the distance from your point, and the 0.00(s) to where you want the Command to be used at (aka your point).