AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dividing Arrays and comparing (https://forums.alliedmods.net/showthread.php?t=12749)

xiiph 04-23-2005 18:42

Dividing Arrays and comparing
 
Okay I want it to do this:

option[] is defined by what keys ppl press when voting.

Code:

new option[2]

if ((option[0] / option[1]) > 0.65) {
      do_this()
}

I cant get this to work, its probably a silly beginner mistake, but plz help anyway.

karlos 04-23-2005 19:31

make sure that "option[1]" is not ZERO

xiiph 04-24-2005 08:37

Thanks tons, will try it :)

XxAvalanchexX 04-24-2005 13:13

You declared option as an integer but check it for a float result? Are you sure that'll work?

xiiph 04-29-2005 00:57

Hmm I donno, but it works :D

Thank you :)

Twilight Suzuka 04-29-2005 13:01

Well, I doubt it if it will work as intended, but it might, as all values in SMALL are really 32 bits. There is no real float or int, they are just tags.


All times are GMT -4. The time now is 09:59.

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