16.01.2014, 09:28
First of all, make the zone.
Then, add this:
This code was for entering zone, now making for leaving zone:
Hope it helped.
Код:
new YourZone; public OnGameModeInit() { YourZone = CreateDynamicRectangle(minx, miny, maxx, maxy, -1, -1, -1); return 1; }
Код:
forward OnPlayerEnterDynamicArea(playerid, areaid); public OnPlayerEnterDynamicArea(playerid, areaid) { if(areaid == YourZone) { GameTextForPlayer(playerid, "You are in ZONE!", 4000, 3);//text in the screen of the player ResetPlayerWeapons(playerid);//this remove arms } return 1; }
Код:
forward OnPlayerLeaveDynamicArea(playerid, areaid); public OnPlayerLeaveDynamicArea(playerid, areaid) { if(areaid == YourZone) { GameTextForPlayer(playerid, "You're exit of the area, permitted weapons!", 4000, 3);//Text in the Screen //You can add more funcions how GivePlayerWeapon.. } return 1; }