SA-MP Forums Archive
Will this make it so a player can rob 5% of the other players money? - 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: Will this make it so a player can rob 5% of the other players money? (/showthread.php?tid=403481)



Will this make it so a player can rob 5% of the other players money? - 101 - 30.12.2012

new cash = GetPlayerMoney(pID);
new Floatteal = cash * 0.05;


and
GivePlayerMoney(playerid, floatround(steal));


Respuesta: Will this make it so a player can rob 5% of the other players money? - lelemaster - 30.12.2012

Try and you'll see, no?

Give a player 100$, then rob him, if you rob him 5$, then it works, if not, it doesn't.


Re: Will this make it so a player can rob 5% of the other players money? - Virus. - 30.12.2012

Yes, this will most probably do it


Re: Will this make it so a player can rob 5% of the other players money? - Konstantinos - 30.12.2012

Just test it and you'll see. If it doesn't work, just use the simpliest way, by getting the money * 5 / 100.


Re: Will this make it so a player can rob 5% of the other players money? - Virus. - 30.12.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
just use the simpliest way, by getting the money * 5 / 100.
Thats what he did. He just simplified it more.