SA-MP Forums Archive
[Include] Simple Deathmatch 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Simple Deathmatch Zones (/showthread.php?tid=442469)



Simple Deathmatch Zones - Yuryfury - 07.06.2013

Simple Deathmatch Zones Include
By: Yuryfury
What is it?
This is an old include that I dug up that I thought some of you might find useful (particularly if you have stunt/freeroam servers). This includes makes it simple to create "deathmatch zones" and regulate what happens when a player either enters or leaves on of these zones.

What functions/callbacks are included?
Functions:
pawn Code:
native CreateDeathmatchZone(Float:minx,Float:miny,Float:maxx,Float:maxy);
native DestroyDeathmatchZone(dmzoneid);
native IsPlayerInDMZone(playerid,dmzoneid);
native IsPlayerInAnyDMZone(playerid);
native GetPlayerDMZone(playerid);
Callbacks:
pawn Code:
OnPlayerEnterDeathmatchZone(playerid,dmzoneid)
OnPlayerLeaveDeathmatchZone(playerid,dmzoneid)
Installation
Simply add the include to the include folder, add "#include<SimpleDMZones>" to any gamemode/filterscript and add the following callbacks:
pawn Code:
public OnPlayerEnterDeathmatchZone(playerid,dmzoneid)
{
    return 1;
}

public OnPlayerLeaveDeathmatchZone(playerid,dmzoneid)
{
    return 1;
}
Download
Pastebin
simply paste into notepad and save as a .inc


Re: Simple Deathmatch Zones - Passout - 14.06.2013

not too much and not too litte,and easy to modify. good work


Re: Simple Deathmatch Zones - Lordzy - 14.06.2013

Nice, I'd suggest you to use SetPlayerWorldBounds in case if player tries to leave the death match zone without the script doing or not. Like adding, LeaveDm(playerid, dmid), and SetRestrictionsForDM(dmid, bool:restrict) so that if it's set to true others would be in the boundary of the DM itself till the DM or unless the script does it or disconnection of a player.