View Single Post
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-31-2019 , 17:20   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #186

Quote:
Originally Posted by Deszzz View Post
Hey Ocixcrom, I took a look at your keywords website for this plugin and I was wondering if there is a possibility to add a function where if player die he loses XP (die by another player instead of suicide).
Good idea, I will add this in the next update. Until I do that, you can use this short sub-plugin:

PHP Code:
#include <amxmodx>
#include <crxranks>

public plugin_init()
{
    
register_plugin("CRXRanks: Death Event""1.0""OciXCrom")
    
register_event("DeathMsg""OnPlayerKilled""a")
}

public 
OnPlayerKilled()
    
crxranks_give_user_xp(read_data(2), _"death"CRXRANKS_XPS_REWARD
After you added it, just use the "death" keyword in the [XP Rewards] section and assign a negative value of XP that you want players to lose when they die. For example: death = -5

Quote:
Originally Posted by LithuanianJack View Post
Perfect! No errors now.

I have additional request for plugin's author ociX. I want to do "web stats" with this plugin, but I need more data inserting - kills, headshots, deaths. Can you add these things saving to SQL?

P.s. I agree with Deszzz's request. Possibility to add a function where if player die he loses XP would be great.
Great, I'll have a look at the edited code and will update the main plugin soon.

Kills, headshots and deaths aren't really related to my plugin, I don't find it logical to add them. You can use the standard CSStats plugin to retrieve this information.
__________________

Last edited by OciXCrom; 01-31-2019 at 17:21.
OciXCrom is offline
Send a message via Skype™ to OciXCrom