Closed gedaskofficial closed 1 year ago
Hi, I can implement api for your purposes, something like this:
forward kz_run_finished(id, runInfo[RunStruct], place, bestPlace);
where runInfo contains time, cp count, tp count and other useful info.
You can use it in your plugin like this:
public kz_run_finished(id, runInfo[RunStruct], place, bestPlace) {
//
// XP calculations
//
give_user_xp(id, calculatedValue, CRXRANKS_XPS_REWARD);
}
That will be fine if you want static xp system. For dynamic xp values (e.g. someone beats you record and you lose some xp) you will need more complicated solution.
Thats awesome!
forward kz_run_finished(id, runInfo[RunStruct], place, bestPlace);
so 'place' would be the #position the player took at that moment? What would be 'bestPlace'? I just looked up the RunStruct and yep, I can see time,cp,tp, etc.
I would be very happy with simple static xp system, where it just depends if the person landed in top15 and gets awarded with xp accordingly #1 being highest. I need to do some research about 'give_user_xp' to find out what the second and third values supposed to be.
Thanks for the response ggv, let me get you a coffee!
I thought 'bestPlace' would be player's best place in top, so you can check if player already competed map with better time. But this will not work as i expected, so probably this parameter not needed.
fa686db
Happy days! Thank you very much ggv!
Hi ggv, thanks for keeping kreedz community alive! This is the best project available publicly so far.
I am trying to implement a ranking system, because I am not familiar with Pawn I thought Im gonna be a bit cheeky and use another ranking plugin. I found a decent one here: https://github.com/OciXCrom/RankSystem , but it rewards xp for kills/headshots/bomb_defusals etc.
When looking through plugins source code I found these:
I guess I would need to change this to lets say:
Maybe you could point me at the right direction please? I would guess that I need to find where the Kreedz plugin decides what place the player gets when he presses stop button and depending on that place award player with XP.
Any kind of guidance would be greatly appreciated! Thanks for your time.
EDIT:
I made some progress. I have found that I need to add this line " crxranks_give_userxp(id, , "kztimer") " when run finishes.
And I guess I need to add it just after run_finish(id); ? This ends up giving XP for every run, not based on place taken.
I would greatly appreciate if someone could guide me where I can find how the top 1/2/3 etc. is generated? Thanks!