SA-MP Forums Archive
Confused. - 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: Confused. (/showthread.php?tid=332858)



Confused. - Jack.7331 - 09.04.2012

So I made a /takedrugs command, it works perfectly, par the fact that when you /takedrugs, it sets your armour to whatever the setarmour does, the only problem is, it should add it to your existing armour.

pawn Код:
SetPlayerArmour(playerid, GetPlayerArmour(playerid) + 1.2*drugamount);
That's the line.
+rep if you help.


Re: Confused. - Jeffry - 09.04.2012

pawn Код:
new Float:armour;
GetPlayerArmour(playerid, armour)
SetPlayerArmour(playerid, armour + 1.2*Float:drugamount);
I suppose that drugamount is an Integer, so that's why the 'Float:' is placed infront of it.