Raised This Month: $12 Target: $400
 3% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Plugin ID:
3861
Plugin Version:
4.0.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plugin for create zones and using natives for create third-party plugins easily
    Old 08-28-2013 , 16:37   [Any] Dev Zones (Zones Manager with natives for developers) [Updated 30-Mar-2021]
    Reply With Quote #1

    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


    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
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 03-30-2021 at 05:43.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 08-28-2013 , 16:37   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #2

    ** 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


    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 12-31-2015 at 09:27. Reason: new module
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    nomy
    Senior Member
    Join Date: Dec 2009
    Location: United Kingdom
    Old 08-28-2013 , 16:41   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #3

    Does it have teleport ability? So if a player enters a zone, the plugin can teleport to another coord?
    nomy is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 08-28-2013 , 16:46   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #4

    Quote:
    Originally Posted by nomy View Post
    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
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 08-28-2013 at 16:47.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    nomy
    Senior Member
    Join Date: Dec 2009
    Location: United Kingdom
    Old 08-28-2013 , 16:52   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #5

    But what about adding the sitio6 coords using menu and not manually?

    Like this: http://forums.eventscripts.com/viewt...p?f=27&t=46447
    nomy is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 08-28-2013 , 17:01   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #6

    Quote:
    Originally Posted by nomy View Post
    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....
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 08-28-2013 at 17:06.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    necavi
    Veteran Member
    Join Date: Sep 2010
    Old 08-28-2013 , 17:22   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #7

    What benefits does this have above directly creating a func_trigger or something similar?
    necavi is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 08-28-2013 , 17:38   Re: [Any] Dev Zones (with natives for developers)
    Reply With Quote #8

    Quote:
    Originally Posted by necavi View Post
    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.
    Mitchell is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 08-28-2013 , 23:57   Re: [Any] Dev Zones (with natives for developers) v1.1
    Reply With Quote #9

    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
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 08-28-2013 at 23:59.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 08-29-2013 , 06:40   Re: [Any] Dev Zones (with natives for developers) v1.2
    Reply With Quote #10

    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]);
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.

    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 00:44.


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