SA-MP Forums Archive
addition and subtraction - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: addition and subtraction (/showthread.php?tid=166448)



addition and subtraction - Yourfatness - 08.08.2010

this is what i am working with. this is all one line, intended to get someone drunk when they pick up the beer. at first i just set their drunk level and it was fine, but it didnt stack. i want them to stack (2 beers=6000 drunk level).
i also wanted the player to lose some health so they wouldnt just completely fill up on alcohol (in RL you will die if you drink too much), but so far all i can get out of it is the player DIES when taking their first drink. i will post more of this script if you need to see more. thank you for any help.

if(pickupid == beer) (newdrunklevel=(drunklevel+3000)), (newhealthlevel=(healthlevel-10)), SetPlayerDrunkLevel(playerid,newdrunklevel), GivePlayerMoney(playerid, -50), SetPlayerHealth(playerid,newhealthlevel);


Re: addition and subtraction - Hiddos - 08.08.2010

Already tried it like:

drunklevel += 3000


Re: addition and subtraction - Yourfatness - 08.08.2010

just tried it, it still killed me. i wish there was a "give health" instead of "set health" cause that would make this easier. i would just use a negative then and be done.