Raised This Month: $ Target: $400
 0% 

OciXCrom's Rank System [XP|Levels|Ranks]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-19-2020 , 13:59   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #11

You want the multiplier to depend on the player's current level? It's a nice idea, added in my to-do list.
For now, you can use this sub-plugin:

Code:
#include <amxmodx> #include <crxranks> const Float:XP_GET_MULTIPLIER = 1.5 const Float:XP_LOSE_MULTIPLIER = 0.5 public plugin_init() {     register_plugin("CRXRanks: XP Multipliers", "1.0", "OciXCrom") } public crxranks_user_receive_xp(id, iXP, CRXRanks_XPSources:iSource) {     if(iSource != CRXRANKS_XPS_ADMIN)     {         return floatround(iXP * crxranks_get_user_level(id) * (iXP > 0 ? XP_GET_MULTIPLIER : XP_LOSE_MULTIPLIER))     }     return CRXRANKS_CONTINUE }

It works like this: XP = XP * player's current level * multiplier

Bear in mind that the XP is a round number, so amounts such as 4.5 will be rounded down.

Quote:
And please make all mysql queries asynchronous if not do it before.
I'm not familiar with what that means. A quick search told me that SQL_ThreadQuery is a asynchronous function and it's used in the plugin.
__________________

Last edited by OciXCrom; 11-19-2020 at 14:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



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 06:14.


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