Gang zone Names
#1

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
Reply
#2

Use IsPlayerInRangeOfPoint

And

GameTextForPlayer
Reply
#3

Okay thanks, but how i know the exact radius?
Reply
#4

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;
Reply
#5

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

Код:
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.
Reply
#7

Thanks, gonna try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)