AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Level System API (https://forums.alliedmods.net/showthread.php?t=272011)

CreePs 09-22-2015 08:20

Level System API
 
3 Attachment(s)
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

HamletEagle 09-22-2015 12:52

Re: Level System API
 
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.


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

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