PDA

View Full Version : dini_IntSet VS dini_FloatSet


jakejohnsonusa
28/02/2013, 08:52 PM
What is the difference between dini_IntSet and dini_FloatSet ?

Please don't give me a link to dini, thanks in advance! :)

LarzI
28/02/2013, 09:08 PM
It's quite self-explanatory, really.

IntSet = Set integer (save an integer)
FloatSet = Set float (save a float)

Integers are whole numbers (2, 304, 2384)
Floats are numbers with decimals (2.43, 304.1234, 2384.39943)

jakejohnsonusa
28/02/2013, 09:11 PM
Thanks +1Rep :)

One more question: what would GetVehicleHealth be? I'm not honestly sure if that uses decimals or not

Strier
28/02/2013, 09:15 PM
http://wiki.sa-mp.com/wiki/GetVehicleHealth

jakejohnsonusa
28/02/2013, 09:16 PM
I looked at that before I asked... in the example it has 1000.0 so does that mean it will be a Float?

LarzI
28/02/2013, 09:20 PM
I looked at that before I asked... in the example it has 1000.0 so does that mean it will be a Float?

To quote:

(vehicleid, &Float:health)
vehicleid ID of the vehicle
&Float:health Variable to store the health in, passed by reference

As you can see, the 2nd parameter says &Float:health.

The ampersand (&) is just to use a reference variable (the value will save to the variable you used)

The tag "Float:" (You can tell it's a tag because it has a colon behind it) tells you what data-type you have to use. So when it says 'Float:', you'll have to use a float variable, unless you want a tag mismatch error.

TL;DR: Yes, you will need a float.

jakejohnsonusa
28/02/2013, 09:29 PM
lol duh, thanks! :)