AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Remove "-" in formatex (https://forums.alliedmods.net/showthread.php?t=294681)

wilianmaique 03-04-2017 19:36

Remove "-" in formatex
 
IMG: http://prntscr.com/eg4c7k

How do I remove this LESS?

CODE:

PHP Code:

formatex(szmenu299"%s \wPatente Menu^n^n\wConta: \r%s \w[OK]^n\wXP: \r%d^n\wPatente: \r%s^n^n\wObs: Falta \r+%d \wde XP para a Patente \r%s\w!"PREFIXaccountxMyXP[id], xRankNames[xMyLevel[id]], xMyXP[id] - xLevels[xMyLevel[id]], xRankNames[xMyLevel[id]+1]) 


fysiks 03-05-2017 00:22

Re: Remove "-" in formatex
 
What is the number supposed to be? My first thought would be that you are doing the math wrong. If that is the case then you probably need to change the order of subtraction.

If it is possible to get both negative and positive values from the calculation (and the math is actually correct) and you need to show only the positive value then you would use take the absolute value of the value with abs(). I doubt that this is the case though so I suggest just fixing your math.

OciXCrom 03-05-2017 07:59

Re: Remove "-" in formatex
 
I think it shows the XP needed for the next level, so:

PHP Code:

xMyXP[id] - xLevels[xMyLevel[id]] 

Simple math... turn them the other way around.

wilianmaique 03-05-2017 10:04

Re: Remove "-" in formatex
 
Quote:

Originally Posted by fysiks (Post 2500907)
What is the number supposed to be? My first thought would be that you are doing the math wrong. If that is the case then you probably need to change the order of subtraction.

If it is possible to get both negative and positive values from the calculation (and the math is actually correct) and you need to show only the positive value then you would use take the absolute value of the value with abs(). I doubt that this is the case though so I suggest just fixing your math.

The math is right, I just want to remove the minus symbol: -

Sorry for my bad english

OciXCrom 03-05-2017 10:39

Re: Remove "-" in formatex
 
Don't ignore my post. The math isn't right, it's backwards.

wilianmaique 03-05-2017 10:54

Re: Remove "-" in formatex
 
Quote:

Originally Posted by OciXCrom (Post 2501016)
Don't ignore my post. The math isn't right, it's backwards.

I do not understand, my friend, I do not know how to speak English very well :(

OciXCrom 03-05-2017 11:03

Re: Remove "-" in formatex
 
PHP Code:

xMyXP[id] - xLevels[xMyLevel[id]] 

===========>

PHP Code:

xLevels[xMyLevel[id]] - xMyXP[id


wilianmaique 03-05-2017 11:09

Re: Remove "-" in formatex
 
Quote:

Originally Posted by OciXCrom (Post 2501024)
PHP Code:

xMyXP[id] - xLevels[xMyLevel[id]] 

===========>

PHP Code:

xLevels[xMyLevel[id]] - xMyXP[id


Thanks :)


All times are GMT -4. The time now is 20:46.

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