Script /water in LSPD - 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: Script /water in LSPD (
/showthread.php?tid=428526)
Script /water in LSPD -
lfreitas - 06.04.2013
hello everyone, i try to make /water in DP for prisoners.
How? if the character stay 40, 50 minutes without eat, he will die, then will need feeding in jail, but the range this is too high...
i can use /water in locker room, and on the jail
code:
Quote:
if(strcmp(cmdtext, "/water", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,6, 251.2, 85.4, 1002.85))
{
new Float:health;
GetPlayerHealth(playerid,health);
format(string, sizeof(string), "* %s drinks some water.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
health += 25.0;
if(health > 100.0)
{
health = 100.0;
}
SetPlayerHealth(playerid, health);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not near a water source !");
return 1;
}
return 1;
}
|
Re: Script /water in LSPD -
[FSaF]Jarno - 06.04.2013
if(IsPlayerInRangeOfPoint(playerid,6, 251.2, 85.4, 1002.85))
the secon parameter, 6, is the radius. Note that this is the RADIUS, and the diameter = radius*2.
Change it to 2 or 4 and it should do the trick.
Re: Script /water in LSPD -
lfreitas - 06.04.2013
Quote:
Originally Posted by [FSaF]Jarno
if(IsPlayerInRangeOfPoint(playerid,6, 251.2, 85.4, 1002.85))
the secon parameter, 6, is the radius. Note that this is the RADIUS, and the diameter = radius*2.
Change it to 2 or 4 and it should do the trick.
|
oooo thanks, i think parameter 6, is interior...
thanks