Raised This Month: $100 Target: $400
 25% 

[ZR] Tools v1.6.1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 01-19-2013 , 03:56   [ZR] Tools v1.6.1
Reply With Quote #1

Requirements:
Zombie:Reloaded 3.1 or higher

Decription:
-----------------------------------------------------------------
Provides some more natives to manage over the player class attributes
-----------------------------------------------------------------

For developers:
-----------------------------------------------------------------
PHP Code:
/**
 * Gets client class section name in the config
 *
 * @param client        Client index.
 * @param buffer        Buffer to store the class section name in.
 * @param maxlen        Max length to store.
 *
 * @return                Number of bytes written to the buffer.
 * @error                If the client is not in game or invalid.
 */
native ZRT_GetClientClassSectionName(clientString:buffer[], maxlen);

/**
 * Gets attribute string of the player's class
 *
 * @param client        Client index.
 * @param attrib        Attribute name.
 * @param buffer        Buffer to store the attribute string in.
 * @param maxlen        Max length to store.
 * @param defvalue        Optional default value to use if the attribute is not found.
 *
 * @return                Number of bytes written to the buffer.
 * @error                If the client is not in game or invalid.
 */
native ZRT_GetClientAttributeString(client, const String:attrib[], String:buffer[], maxlen, const String:defvalue[] = "");

/**
 * Gets attribute numeric value of the player's class
 *
 * @param client        Client index.
 * @param attrib        Attribute name.
 * @param defvalue        Optional default value to use if the attribute is not found.
 *
 * @return                Retrieves the numeric value.
 * @error                If the client is not in game or invalid.
 */
native ZRT_GetClientAttributeValue(client, const String:attrib[], defvalue 0);

/**
 * Gets attribute floating value of the player's class
 *
 * @param client        Client index.
 * @param attrib        Attribute name.
 * @param defvalue        Optional default value to use if the attribute is not found.
 *
 * @return                Retrieves the floating value.
 * @error                If the client is not in game or invalid.
 */
native Float:ZRT_GetClientAttributeValueFloat(client, const String:attrib[], Float:defvalue 0.0);

/**
 * Whether the player has attribute
 *
 * @param client        Client index.
 * @param attrib        Attribute name.
 *
 * @return                True on success, false otherwise.
 * @error                If the client is not in game or invalid.
 */
native bool:ZRT_PlayerHasAttribute(client, const String:attrib[]);

/**
 * Whether the round is active
 *
 * @noparams
 *
 * @return                True on round active, false otherwise
 * @noerror
 */
native bool:ZRT_IsRoundActive(); 
-----------------------------------------------------------------

Installation:
-----------------------------------------------------------------
1. Put zr_tools.smx to the sourcemod/plugins folder
2. Put zr_tools.sp to the sourcemod/scripting folder
3. Put zr_tools.inc to the sourcemod/scripting/include folder
4. Restart server or change map or type sm plugins load zr_tools in the server console or via rcon command
-----------------------------------------------------------------

Changelog:
Code:
  • v1.6 - First release on AlliedModders
  • v1.6.1 - Changed natives prefix to ZRT
Attached Files
File Type: inc zr_tools.inc (3.0 KB, 1623 views)
File Type: smx zr_tools.smx (5.4 KB, 1730 views)
File Type: sp Get Plugin or Get Source (zr_tools.sp - 1338 views - 6.5 KB)

Last edited by Despirator; 01-19-2013 at 04:44.
Despirator is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 01-19-2013 , 04:02   Re: [ZR] Tools v1.6
Reply With Quote #2

Nice! My idea for a better class API is quite similar where you can query attributes like you do.

Although I suggest you change the prefix of the natives to ZRT (for ZR Tools) or something, or future API changes in ZR might conflict with this plugin.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 01-19-2013 , 04:43   Re: [ZR] Tools v1.6.1
Reply With Quote #3

ok, changed
Despirator is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Somewhere near you
Old 03-11-2013 , 13:34   Re: [ZR] Tools v1.6.1
Reply With Quote #4

Could you make example of zombie specific abilities for example double jump?

Last edited by iGANGNAM; 03-11-2013 at 13:35.
iGANGNAM is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 03-11-2013 , 14:54   Re: [ZR] Tools v1.6.1
Reply With Quote #5

Quote:
Originally Posted by iGANGNAM View Post
Could you make example of zombie specific abilities for example double jump?
set attribute "max_double_jumps" to any class you want to have double jumps to a number of max jumps for example 2 or 3. Zero and negative values disables double jumps on a class. Default value is 0
Attached Files
File Type: smx zr_doublejump.smx (4.8 KB, 81 views)
File Type: sp Get Plugin or Get Source (zr_doublejump.sp - 127 views - 4.3 KB)
Despirator is offline
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 22:06.


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