[Include] Simple Deathmatch Zones
#1

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)