AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Dev Zones (Zones Manager with natives for developers) [Updated 30-Mar-2021] (https://forums.alliedmods.net/showthread.php?t=224839)

Franc1sco 08-28-2013 16:37

[Any] Dev Zones (Zones Manager with natives for developers) [Updated 30-Mar-2021]
 
Description:

Plugin for create zones and using natives for create third-party plugins easily.

Zones are saved in config files by maps: configs/dev_zones/mapname.zone.txt

Directory and files are created automaticaly.
If you got any error you need to modify directory or file permissions.


Commands:

sm_zones (!zones in chat) for open the main menu and create/edit/remove zones (Required admin flag "t" for use).


Cvars:
Put in server.cfg
Code:

sm_devzones_filter "1" // 1 = Only allow valid alive clients to be detected in the native zones. 0 = Detect entities and all (you need to add more checkers in the third party plugins).
sm_devzones_mode "1" // 0 = Use checks every X seconds for check if a player join or leave a zone, 1 = hook zone entities with OnStartTouch and OnEndTouch (less CPU consume)
sm_devzones_checker "5.0" // checks and beambox refreshs per second, low value = more precise but more CPU consume, More hight = less precise but less CPU consume
sm_devzones_model "models/error.mdl" // Use a model for zone entity (IMPORTANT: change this value only on map start)


Natives:

Code:

/**
 * Check if a player are there in a zone
 *
 * @param client    Player for check
 * @String zone    Zone name
 * @bool equal    Check exact zone name or parcial name
 * @bool caseSensitive    If true, comparison is case sensitive. If false, comparison is case insensitive.
 * @return true if player are there in the zone given in Zone String
 */
native bool Zone_IsClientInZone(int client, const char[] zone, bool equal = true, bool caseSensitive = false);

/**
 * Check if a position is in a zone
 *
 * @param client    Player for check
 * @String zone    Zone name
 * @float posx      X-Pos
 * @float posx      Y-Pos
 * @float posx      Z-Pos
 * @return true if position is in a zone or not
 */
native bool Zone_isPositionInZone(const char[] zone, float posx, float posy, float posz, bool equal = true);

/**
 * Check if zone exists
 *
 * @String zone    Zone name
 * @bool equal    Check exact zone name or parcial name
 * @bool caseSensitive    If true, comparison is case sensitive. If false, comparison is case insensitive.
 * @return true if zone exist
 */
native bool Zone_CheckIfZoneExists(const char [] zone, bool equal = true, bool caseSensitive = false);

/**
 * Called when a player has entered in a zone.
 * @param client  client that has entered in the zone.
 * @String zone  Zone name.
 */
forward void Zone_OnClientEntry(int client, const char [] zone);

/**
 * Called when a player has left a zone.
 * @param client  client that has left the zone.
 * @String zone  Zone name.
 */
forward void Zone_OnClientLeave(int client, const char [] zone);

/**
 * Get a zone position
 * @String zone  Zone name to search position.
 * @bool caseSensitive    If true, comparison is case sensitive. If false, comparison is case insensitive.
 * @Float Position  Array when the zone position will be copied
 * @return true on successfully, false otherwise
 */
native int Zone_GetZonePosition(const char [] zone, bool caseSensitive = false, float Position[3]);

/**
 * Get a zone coordinates
 * @String zone  Zone name to search coordinates.
 * @bool caseSensitive    If true, comparison is case sensitive. If false, comparison is case insensitive.
 * @Float CordA  Array when the zone coordinates A will be copied
 * @Float CordB  Array when the zone coordinates B will be copied
 * @return true on successfully, false otherwise
 */
native int Zone_GetZoneCord(const char [] zone, bool caseSensitive = false, float CordA[3], float CordB[3]);


/**
 * @Param1 -> int client
 * @Param2 -> char[64] zoneBuffer       
 * @return true if zone found false if not
 */
native bool Zone_getMostRecentActiveZone(int client, char zoneBuffer[64]);

/**
 * Called when a zone is created.
 * @String zone  Zone name.
 */
forward void Zone_OnCreated(const char [] zone);



Suggestions are welcome :3


Donations (optional):

If you apreciate my work, you can donate me via paypal or with a trade offer


Download:

Main repository
Direct download
Code changes

Franc1sco 08-28-2013 16:37

Re: [Any] Dev Zones (with natives for developers)
 
** Reserved for third-party plugins **


Deathmatch minigame for dead players:

Here


Jail zones:

Called jail zones. Zone that prevents people outside the zone doing damage to players inside the zone.

https://github.com/Franc1sco/DevZone.../DevZones_Jail


Unlimited ammo zones:

Here


Devzones Tester:

For test natives, appear a msg when you join or left a zone

Download here


Slap Zones:

When you entry in a zone that have in the name "SlapTT" and you are a T, or in a zone "SlapCT" and you are a CT or in a zone "SlapANY" you will be slapped

See defines in the .sp and configure it as you want

Download here


Teleport Zones:

All info here


AntiCamp Zones:

All info here


NoEntry zones:

Called noentry where players cant join - https://github.com/Franc1sco/DevZone...vZones_NoEntry


NoBlock zones:

Called noblock where players have noblock - https://github.com/Franc1sco/DevZone...vZones_NoBlock


NoDamage zones:

Called nodamage where players cant hurt each others - https://github.com/Franc1sco/DevZone...Zones_NoDamage


Hide zones:

"hide" zones where your teammates are hide for improve the vision. Ideal for zombie servers where a lot of teammates reduce your vision in X zones. - https://github.com/Franc1sco/DevZone.../DevZones_Hide


:3

nomy 08-28-2013 16:41

Re: [Any] Dev Zones (with natives for developers)
 
Does it have teleport ability? So if a player enters a zone, the plugin can teleport to another coord?

Franc1sco 08-28-2013 16:46

Re: [Any] Dev Zones (with natives for developers)
 
Quote:

Originally Posted by nomy (Post 2023596)
Does it have teleport ability? So if a player enters a zone, the plugin can teleport to another coord?

You can do it easily using natives of this plugin


For example:

PHP Code:

#pragma semicolon 1
#include <sourcemod>
#include <devzones>

#define sitio6 {-2236.0, -1440.0, -636.4} // soccer coords

public Zone_OnClientEntry(clientString:zone[])
{
    new 
Float:site6[3] = sitio6;
    
TeleportEntity(isite6NULL_VECTORNULL_VECTOR); // teleport to soccer when you join in a zone



Soon I will make a few plugins using this natives

nomy 08-28-2013 16:52

Re: [Any] Dev Zones (with natives for developers)
 
But what about adding the sitio6 coords using menu and not manually?

Like this: http://forums.eventscripts.com/viewt...p?f=27&t=46447

Franc1sco 08-28-2013 17:01

Re: [Any] Dev Zones (with natives for developers)
 
Quote:

Originally Posted by nomy (Post 2023601)
But what about adding the sitio6 coords using menu and not manually?

Like this: http://forums.eventscripts.com/viewt...p?f=27&t=46447

that is not within the plan for the plugin, but maybe is possible create a third-plugin like it, I will see....

necavi 08-28-2013 17:22

Re: [Any] Dev Zones (with natives for developers)
 
What benefits does this have above directly creating a func_trigger or something similar?

Mitchell 08-28-2013 17:38

Re: [Any] Dev Zones (with natives for developers)
 
Quote:

Originally Posted by necavi (Post 2023617)
What benefits does this have above directly creating a func_trigger or something similar?

1. A trigger will take up Entities. (there is a cap at 2048 which will lockup the server)
2. This is alot easier, and simple. instead of relying on hooks of the trigger it will detect on it's own.
im sure there are more reasons.

Franc1sco 08-28-2013 23:57

Re: [Any] Dev Zones (with natives for developers) v1.1
 
New version v1.1

-Bugfixes in "Zone_IsClientInZone" native
-Now you can configure checks per second with a #define in .sp file and recompile as you want


Check second post for third-party plugins

Franc1sco 08-29-2013 06:40

Re: [Any] Dev Zones (with natives for developers) v1.2
 
New version v1.2

-Added caseSensitive value in the "Zone_IsClientInZone" native and update Slap Zones plugin for use version 1.2
-Added new native:
Code:

/**
 * Get a zone position
 * @String zone  Zone name to search position.
 * @bool caseSensitive    If true, comparison is case sensitive. If false, comparison is case insensitive.
 * @Float Position  Array when the zone position will be copied
 * @return true on successfully, false otherwise
 */
native Zone_GetZonePosition(String:zone[], bool:caseSensitive=false, Float:Position[3]);



All times are GMT -4. The time now is 22:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.