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

Level System API


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
CreePs
Member
Join Date: Mar 2011
Old 09-22-2015 , 08:20   Level System API
Reply With Quote #1

Level System API
v1.0
by CreePs


Introduction:

This level system is only the main system that means you got to make what you want every level.
there is alot of API so it will be easy to make addons for this level system


Admin Console Commands:

Code:
Cvar's:

kill_xp "num" - give xp for each kill * default "5" *
hs_xp "num" - give xp for each headshot kill * default "2" *
he_xp "num" - give xp for each he grenade kill * default "2" *
knife_xp "num" - give xp for each knife kill * default "3" *
Client Chat Commands:

Code:
say /level or /xp - to show your stats
Plugin API:

Code:
/**
 *
 * register max level and started xp
 * 
 * @maxlevel        the level max
 * 
 * @started_xp_level     the started xp for first level
 *
 * @noreturn
 */
native register_maxlevels( maxlevel = 25, started_xp_level = 100 );


/**
 *
 * get user level info
 * 
 * @param        Client - Index of player
 *
 * @return       user level info
 */
native get_user_level( index );

/**
 *
 * set user level
 * 
 * @param        Client - Index of player
 *
 * @param        Number - of level you set
 *
 * @noreturn
 */
native set_user_level( index, level );

/**
 *
 * get user xp info
 * 
 * @param        Client - Index of player
 *
 * @return       user xp info
 */
native get_user_xp( index );

/**
 *
 * set user xp
 * 
 * @param        Client - Index of player
 *
 * @param        Number - of xp you set
 *
 * @noreturn
 */
native set_user_xp( index, level );

/**
 *
 * Called when player level up
 *
 * @param        Client - Index of player
 *
 * @param        Number - of level
 *
 * @param        Number - of xp 
 *
 * @return        Client info of level and xp
 *
 */
forward forward_client_levelup( index, level, xp );



/**
 *
 *
 * @param        Client - Index of player
 *
 * @param        Number - of level
 *
 * @param        Number - of xp 
 *
 * @return        Client info of level and xp
 *
 */
forward forward_client_spawn( index, level, xp );


Plugin Requirements:
  • AMX Mod X 1.8.0 or higher
  • Steam
  • FVault System


Credits:
CreePs - made the plugin
Exolent[jNr] - FVault System


Changelog:
Code:
* v1.0 
- first public release
Note:

REMEMBER this is only the main plugin not any addons of levels only the main system
you need to make the addons of what you want to every level will do

you can post here request of addons for the level system and i will make them if i will have time

Enjoy
Attached Files
File Type: inc LevelSystem.inc (1.6 KB, 705 views)
File Type: sma Get Plugin or Get Source (Level-System.sma - 1795 views - 6.7 KB)
File Type: sma Get Plugin or Get Source (Commands-Addons.sma - 1401 views - 5.2 KB)
__________________
My Plugin's:

Last edited by CreePs; 09-22-2015 at 08:25.
CreePs is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-22-2015 , 12:52   Re: Level System API
Reply With Quote #2

That API is useless. Let me point a few things:
1.Creating a forward that is executed from a default forward is totally silly. Why would I use your plugin and not use directly Ham_Spawn ? Using the ham is a more direct way, so better. Not saying you are not putting proper checks(i.e to check if an user is alive before firing the forward).
2.What your API is doing is just to hook DeathMsg and give XP for some predefined actions, that's something what everyone can do inside his plugin. You gain nothing with using an API in this case, you just decrease performance. What you are doing here is what every levemod does, if you want to create an API make something more interesting.
API is for giving some control over some thing that is hard to do in general.
3.You have XP for cvars, this should be exposed to the API too, maybe letting people to register their own actions for receiving XP, you can even allow xp decreasing.

Code also requiere some fixing.

Unapproved because this api does not seem to be usefull for some purpose.
__________________
HamletEagle is offline
Reply



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 08:27.


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