Raised This Month: $ Target: $400
 0% 

Xp problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kiarronis
Junior Member
Join Date: Jan 2022
Location: Argentina
Old 01-19-2022 , 17:45   Re: Xp problem
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
No need to build a string to achieve a floating point value. Simply float the variable and divide by 100.0 and add 1.0 (to achieve this same calculation).

When I first saw the request, I thought he was requesting something more related to the relative XP between the killer and the victim but the OP didn't clearly state how he wanted it to work. There are many different algorithms that could be use and this one should work well enough, IMO.

However, you're now completely ignoring the third parameter of the native which could be a big confusing in the long run. I think that maybe this type of modification should really go in the plugin that is calling these functions and passing the multiplier value into the function like normal.
Yes, i'm requesting about the relative XP between the killer and the victim. Thank's bigdaddy for the code but i tried it and it didn't work, able i put it wrong. I need to get more xp when i kill somebody higher lvl than me. Sorry for my english, i'm argentinian and i'm newbie in the programming

Last edited by kiarronis; 01-19-2022 at 17:47.
kiarronis is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-19-2022 , 23:19   Re: Xp problem
Reply With Quote #2

Quote:
Originally Posted by kiarronis View Post
I need to get more xp when i kill somebody higher lvl than me.
I think we understand that but how do you want it calculated? Use a simple example. Player A has 10 XP and Player B has 18 XP. If Player A kills Player B, how much XP does Player A gain? This is currently simply set to a constant value defined in the INI file. Also, explain what happens the other way around.

I made the modifications to give double XP if you kill a player that has higher XP than you do so that you can test to make sure that it works at all. When you provide more specific details on how much more XP you are actually wanting to add then we can change it.
Attached Files
File Type: sma Get Plugin or Get Source (superheromod.sma - 36 views - 182.1 KB)
__________________

Last edited by fysiks; 01-19-2022 at 23:21.
fysiks is offline
kiarronis
Junior Member
Join Date: Jan 2022
Location: Argentina
Old 01-20-2022 , 01:16   Re: Xp problem
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
I think we understand that but how do you want it calculated? Use a simple example. Player A has 10 XP and Player B has 18 XP. If Player A kills Player B, how much XP does Player A gain? This is currently simply set to a constant value defined in the INI file. Also, explain what happens the other way around.

I made the modifications to give double XP if you kill a player that has higher XP than you do so that you can test to make sure that it works at all. When you provide more specific details on how much more XP you are actually wanting to add then we can change it.
That code superhero.amxx doesn't change anything.... i don't know why
kiarronis is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 01-20-2022 , 20:48   Re: Xp problem
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
I think we understand that but how do you want it calculated? Use a simple example. Player A has 10 XP and Player B has 18 XP. If Player A kills Player B, how much XP does Player A gain? This is currently simply set to a constant value defined in the INI file. Also, explain what happens the other way around.

I made the modifications to give double XP if you kill a player that has higher XP than you do so that you can test to make sure that it works at all. When you provide more specific details on how much more XP you are actually wanting to add then we can change it.
He wants to get bonus points whenever he kills an enemy who's higher level than he is.
Code:
new diff = gPlayerLevel[victim] - gPlayerLevel[id] if (diff)     new float: multiplier = (diff / 100.0) + 1.0
bigdaddy424 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-21-2022 , 21:59   Re: Xp problem
Reply With Quote #5

Quote:
Originally Posted by bigdaddy424 View Post
He wants to get bonus points whenever he kills an enemy who's higher level than he is.
Thank you captain obvious. I said that I already know what he wants. There are 10 million ways to do the calculation and I'm just asking which one he's looking for. You method you chose is entirely arbitrary and assumes a value of 100.0 as a divisor makes sense.

Quote:
Originally Posted by kiarronis View Post
That code superhero.amxx doesn't change anything.... i don't know why
Are you sure you're running the new code? If you run "amxx list" in the server console, what is the version that is shown for this plugin? I changed it so that we could make sure we can know the new code is actually being executed.
__________________
fysiks 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 11:30.


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