uh... percentage help - 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: uh... percentage help (
/showthread.php?tid=110666)
uh... percentage help -
DiddyBop - 27.11.2009
How do i make it so it says to the killerid how much money it lost in the percentage deduction of his cash? here is my code..
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
}
else
{
SendDeathMessage(killerid,playerid,reason);
new integer:money, s[64];
GivePlayerMoney(killerid, -(GetPlayerMoney(playerid) / 50));
format(s, sizeof(s), "You've lost $%i For DeathMatching!", money);
SendClientMessage(killerid, 0xFFFFFFAA, s);
ResetPlayerWeapons(killerid);
}
return 1;
}
all it says in-game is "You've lost $0 For DeathMatching!"
a little help? :S
Re: uh... percentage help -
DiddyBop - 28.11.2009
nobody knows?
Re: integers... -
Nero_3D - 28.11.2009
maybe try to store something in money ^^"
and for the perantage
pawn Код:
new percentage = GetPlayerMoney(playerid) / 50 * 100 / GetPlayerMoney(killerid);
sure that the killer gets -2% of the victims money ?