Raised This Month: $ Target: $400
 0% 

negative value <---> positive value


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 11-21-2011 , 06:21   negative value <---> positive value
Reply With Quote #1

give a other way? as
Code:
a = -13
b = a + a*2
b == 13
Code:
a = 13
b = a - a*2
b == -13
__________________

Working on:
nothing
schmurgel1983 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-21-2011 , 06:24   Re: negative value <---> positive value
Reply With Quote #2

what the hell is that?
a = -b
b = -a
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 11-21-2011 , 06:27   Re: negative value <---> positive value
Reply With Quote #3

change -13 to 13 (negative value -> positive value)
change 13 to -13 (positive value -> negative value)
or 145 to -145.... etc.
don't find a native from amxx that do it.
__________________

Working on:
nothing
schmurgel1983 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-21-2011 , 06:29   Re: negative value <---> positive value
Reply With Quote #4

I already told u,
b = -a;
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 11-21-2011 , 06:34   Re: negative value <---> positive value
Reply With Quote #5

dosen't understand, next mate please.
__________________

Working on:
nothing
schmurgel1983 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-21-2011 , 06:35   Re: negative value <---> positive value
Reply With Quote #6

or u can do

b *= -1
Devil259 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-21-2011 , 06:44   Re: negative value <---> positive value
Reply With Quote #7

Quote:
Originally Posted by schmurgel1983 View Post
dosen't understand, next mate please.
which part of that you don't understand ? Isn't it obvious ?
Code:
new a = 13;
new b = -a;

new c = -13;
new d = -c;
if you still don't understand after reading above, then check your IQ please.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 11-21-2011 , 06:45   Re: negative value <---> positive value
Reply With Quote #8

Quote:
Originally Posted by jim_yang View Post
if you still don't understand after reading above, then check your IQ please.
what is the problem if u explaine your shit?
Code:
a = 5 ; b *= a => 0
a = -5 ; b *= a => 0
a = 8 ; b = -a => -8
a = -8 ; b = -a => 8
thanks Devil259 for your try ^^
__________________

Working on:
nothing

Last edited by schmurgel1983; 11-21-2011 at 06:47.
schmurgel1983 is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 11-21-2011 , 07:19   Re: negative value <---> positive value
Reply With Quote #9

Quote:
Originally Posted by schmurgel1983 View Post
what is the problem if u explaine your shit?
Code:
a = 5 ; b *= a => 0
a = -5 ; b *= a => 0
a = 8 ; b = -a => -8
a = -8 ; b = -a => 8
thanks Devil259 for your try ^^
What can't you understand ? a 9 year old kid can do it simple math.

a = 13
b = -a

so b = -13

a = -13
b = -a

so b = 13

Last edited by MyPc; 11-21-2011 at 07:21.
MyPc is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-21-2011 , 07:20   Re: negative value <---> positive value
Reply With Quote #10

By multiplying the variable by -1, you should do what he wants. (negative value <---> positive value)

a = 6

If you want to have the negative value of a in the same variable, you can do

a *= -1

a is -6 now.
Devil259 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 08:28.


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