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



Gang Zones - wallen - 26.02.2018

Just wanted to know, how do i send a text to a player that enters a gang zone i made? something like "you entered on a restricted area" etcc or anything like that well, how?

Lets suppose that is my gang zone.

PHP код:
airport GangZoneCreate(1276.906, -2684.5882155.362, -2167.434); 
how do i detect that a player entered the gang zone ?


Re: Gang Zones - Eric_White - 26.02.2018

Do you want to know how they entered or do you want them to receive a message for example once you have reached the range given on the coordinate it automatically sends you a message?


Re: Gang Zones - wallen - 26.02.2018

yeah, once you'll enter the gang zone and reached the range given


Re: Gang Zones - Eric_White - 26.02.2018

PHP код:
airport GangZoneCreate(1276.906, -2684.5882155.362, -2167.434) return SendClientMessage(playeridCOLOR_RED"You have entered a restricted area");  
return 
1
Try something like that


Re: Gang Zones - wallen - 26.02.2018

Really that easy lol, yeah i'll try.

EDIT: Since i've made it on ongamemodeinit, the "playerid" is not defined there.


Re: Gang Zones - Cypress - 26.02.2018

Quote:
Originally Posted by Eric_White
Посмотреть сообщение
PHP код:
airport GangZoneCreate(1276.906, -2684.5882155.362, -2167.434) return SendClientMessage(playeridCOLOR_RED"You have entered a restricted area");  
return 
1
Try something like that
Are you drunk?


Here is what you need, including the functions to check if the player is on a specific turf.

https://sampforum.blast.hk/showthread.php?tid=276352

So doing something like

Код:
 
if ( IsPlayerInZone( playerid, airoport ) )
    return SendClientMessage( playerid, -1, "Please leave!" );
You'd have to have a 1 second timer where you deal with this kind of checks on your server, and from there it will be easy adding this one.