Raised This Month: $32 Target: $400
 8% 

Xp problem


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-19-2022 , 23:19   Re: Xp problem
Reply With Quote #11

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 - 31 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 #12

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 #13

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
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-21-2022 , 00:33   Re: Xp problem
Reply With Quote #14

PHP Code:
new Float:multiplier = (gPlayerLevel[victim] / floatmax(float(gPlayerLevel[id]),1.0)); 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-21-2022 at 00:35.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-21-2022 , 21:59   Re: Xp problem
Reply With Quote #15

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


Thread Tools
Display Modes

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 10:32.


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