SA-MP Forums Archive
Can you do this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can you do this? (/showthread.php?tid=569536)



Can you do this? - K9IsGodly - 31.03.2015

Can you do calculations with two variables? I know in pawn it lets you do this as an ex:

Armour + amount
Armour / amount
Armour * amount
Armour - amount

Well could you do Armour + Health, two variables that already have a value and add them?


Re: Can you do this? - BleverCastard - 31.03.2015

Try it out. You can only be wrong or right.


Re: Can you do this? - CalvinC - 31.03.2015

Sure you can.
pawn Код:
new
    Float: HP,
    Float: AR,
    Float: HPARCombined
;
GetPlayerHealth(playerid, HP);
GetPlayerArmour(playerid, AR);
HPARCombined = HP + AR;
Something like this will work fine.