SA-MP Forums Archive
string errorz - 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: string errorz (/showthread.php?tid=110672)



string errorz - 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: string errorz - DiddyBop - 28.11.2009

nobody knows..?


Re: string errorz - notime - 28.11.2009

well, the "new integer:money" is useless just "new money" is enough
then, money is always 0, because you didnt define what money is
try:
money = GivePlayerMoney(killerid, -(GetPlayerMoney(playerid) / 50));
then it will work.
oh and the "you've lost %d money" doesnt make sence because now your telling the killerid(who should be rewarded) losses the %d money.
so that should be playerid instead of killerid


Re: string errorz - DiddyBop - 28.11.2009

thx u