SA-MP Forums Archive
Gang zone Names - 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: Gang zone Names (/showthread.php?tid=108899)



Gang zone Names - juuleman - 16.11.2009

Hey,

I created some gang zones at my server, but i want it like this:

If a player gets in the territory he gets a TextDraw at the middle buttom of his screen like this '[ECR] Territory'.

How do i script that?

SancheZ



Re: Gang zone Names - Peter_Corneile - 16.11.2009

Use IsPlayerInRangeOfPoint

And

GameTextForPlayer


Re: Gang zone Names - juuleman - 16.11.2009

Okay thanks, but how i know the exact radius?


Re: Gang zone Names - Blantas - 16.11.2009

Yes, but server all the time will spam messages to player that he is in gangzone. To avoid it, you should create a new bool for player, so if player enters zone you just set it to for example ZoneEntered[playerid] = true. Then when sending msg just check that boolean:
Код:
if(!ZoneEntered[playerid])
{
      GameTextForPlayer(playerid, ...
      ZoneEntered[playerid] = true;
}
else return 1;



Re: Gang zone Names - Peter_Corneile - 16.11.2009

Yes make a Global Variable and the radius i think must be guessed .. I am not sure about it


Re: Gang zone Names - Blantas - 16.11.2009

Код:
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
return 0;
}
is better than IsPlayerInRangeOfPoint.


Re: Gang zone Names - juuleman - 16.11.2009

Thanks, gonna try it.