Bounty System
#1

I have a minor problem with my hit/bounty system. The command functions this way:
Someone places a hit (/hit ID amount), and when someone killed the hit, the one who did the hit will lose his money and the killer will receive the amount. However that's not the case in my situation. The guy who place the hit doesn't get withdrawed, but the guy who does the hit gets paid 3x the amount. So if someone placed 500$ he won't lose the 500$ but the one who claims the hit will receive $1500 instead of $500. I hope I summed it up clear enough.

Here's the code OnPlayerDeath.

pawn Код:
if(reason <= 46 && hit[playerid] != 0)
    {
        new string[256];
        format(string, sizeof(string), "%s (ID: %i) killed %s (ID: %i) and recieved $%i for completing the hit!", ReturnPlayerName(killerid), killerid, ReturnPlayerName(playerid), playerid, hit[playerid]);
        SendClientMessageToAll(COLOR_GREEN, string);
        a_GivePlayerMoney(killerid, hit[playerid]);
        a_GivePlayerMoney(hiter[playerid], GetPlayerMoney(hiter[playerid])-hit[playerid]);
        PlayerInfo[killerid][TotalHits]++;
        new Query1[128];
        format(Query1, sizeof(Query1), "UPDATE `Users` SET `TotalHits` = '%d' WHERE Name = '%s'", PlayerInfo[killerid][TotalHits], escstring(PlayerName2(killerid)));
        mysql_query(Query1);
        mysql_store_result();
       
        hit[playerid] = 0;
    }
Ignore the MYSQL, it has no influence.
Reply
#2

Anyone?
Reply
#3

pawn Код:
a_GivePlayerMoney(hiter[playerid], GetPlayerMoney(hiter[playerid])-hit[playerid]);
should be

pawn Код:
a_GivePlayerMoney(hiter[playerid], -hit[playerid]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)