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



Medical Fees - sscarface - 12.01.2013

Can you give me Medical Fees scripting codes?

Medical Fees Depends On Player Money.


Re: Medical Fees - LarzI - 12.01.2013

You should post here https://sampforum.blast.hk/showthread.php?tid=187229&page=327 if you want code given to you, although I'll provide an example for you and explain how and why.

OnPlayerDeath, you'll need to get the players money and store it in a variable
pawn Код:
//example var
new
    playerMoney;
Then you'll need to subtract a percent of that - let's say you want to subtract 5% of the players money on death, you'd do something like this:
pawn Код:
playerMoney = GetPlayerMoney( playerid );
GivePlayerMoney( playerid, ( -( playerMoney * 0.05 ))); // - for subtraction.
And there you have it.