Hello need help about IsPlayerInArea please 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hello need help about IsPlayerInArea please help. (
/showthread.php?tid=215686)
Hello need help about IsPlayerInArea please help. -
trapped1 - 23.01.2011
So I cant get it how the code works I tried to get the script working but no effect. SO I'm here.
I need help about if player is in zone, he gets message--> "You are now in Grove zone you are not safe...."
Please some one help me.
Sincerely Your Trapped. Thanks for help.. (I know for thanks you cant buy nothing)
Код:
forward AreaCheck(playerid)
SetTimer("AreaCheck", 3000, 1);
public AreaCheck(playerid)
{
new Float:h;
for(new i=0; i<MAX_PLAYERS; i++ )
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInArea(i,2989.536, -2989.536, 502.1487,-2942.825) && IsPlayerAlive[i])
{
SetPlayerHealth(i, 0.0);
SendClientMessage(i, COLOR_RED, "Danger Zone!");
}
if(IsPlayerInArea(i, -1331.278, -3001.214, 1634.903, 443.7593) && IsPlayerAlive[i])
{
SetPlayerHealth(i, GetPlayerHealth(i, h) -1.0);
SendClientMessage(i, COLOR_RED, "Danger Zone!");
}
}
}
Re: Hello need help about IsPlayerInArea please help. -
Janek17 - 23.01.2011
show the code!!
Re: Hello need help about IsPlayerInArea please help. -
trapped1 - 23.01.2011
So I edited the post so you can see
Re: Hello need help about IsPlayerInArea please help. -
trapped1 - 24.01.2011
bump
Re: Hello need help about IsPlayerInArea please help. -
Grim_ - 24.01.2011
Do the other messages get sent? Are you sure the coordinates are correct?
Also, the following line will not work:
pawn Код:
SetPlayerHealth(i, GetPlayerHealth(i, h) -1.0);
GetPlayerHealth stores the player's health within the given variable, the function doesn't return the value itself. You will need to adjust the code, like so, to get it to work correctly
pawn Код:
GetPlayerHealth( i, h );
SetPlayerHealth( i, h - 1.0 );