all money robbed, i want only 15% from the total money in hand
#1

why this happens?
when i rob someone it rob alllll of his money, i want only to rob Devide 15 of his money not all.

if i have 10000 cash and someone rob from me 10000 it will be robbed all, i want them to rob only 10000, Devide 15 of 10000

Devide 15 of the money in hand
not all money
see code

10000 devide 15 = 666 or 667 idk lol

pawn Code:
pawn Код:
GetPlayerMoney(id)* ( 1 - 15 / 100 );
plz give me a new code not explain
Reply
#2

someone help plz
Reply
#3

mmh

Код:
(15 * playermoney) / 100
percent you want * current money all / 100..
Reply
#4

(15 *GetPlayerMoney(playerid)) / 100

Like this brother?
Reply
#5

...

pawn Код:
new Float:money = GetPlayerMoney(playerid);
money = (money * 0.15);
money = Floatround(money);
Reply
#6

pawn Код:
new Rob = (15 * GetPlayerMoney(idtorob)) / 100;
Edit:
If you don't know now Rob is now the variable with the rob amount (your 15%)

you can now sub Rob from player that is robbed
and add Rob to player that robbed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)