Weird money problem.
#1

Somewhy GivePlayerMoney is called, but then seconds after all the money is being reset. I do not have any kind of anticheat or an include that would have one. The funny thing is that I'm not even using ResetPlayerMoney in the whole script.

pawn Код:
MySQL::OnPlayerProfileLoad (playerid)
{
        <...>pInfo [playerid][pMoney] = cache_get_field_content_int (0, "Money");

    SendFormattedClientMessage (playerid, col_WHITE, "before %d", pInfo [playerid][pMoney]);
    GivePlayerMoney (playerid, pInfo [playerid][pMoney]);
    SendFormattedClientMessage (playerid, col_WHITE, "after %d", pInfo [playerid][pMoney]);

        <...>
Although if I use a command to give player some money, the server doesn't take it away.
Reply
#2

maybe you use server side money?
if you use filterscript, check it
Reply
#3

Check your includes at the top of your script, there may be "MoneyHax" include to prevent players hacking their cash (if you DL-ed the GM and you dont know about this), if you have it, add it to all of your FS's as (#include MoneyHax_FS) or either remove it from everywhere. Seems like you have an AC because it resets your cash, it only doesnt when you give them with AdminCmd right ?
Reply
#4

There must be a (filter)script or include responsible for this behavior (or your own script). Money doesn't reset itself.
Reply
#5

I found the problem - somehow it's fixes.inc. Looks like Im not the only one with such problem: click

Does anybody have an idea how to fix this without deleting the library?
Reply
#6

Create a new file in pawno, select everything and replace it with the code below:
Код:
// --- Fixes.inc Money Fixer ----------------- By: suicidal.banana
// Quick and dirty fix for money bug of fixes.inc, because why not
#include <a_samp>

new playerMoneyValues[MAX_PLAYERS],
    moneyFixDelay = 2500; // 1000 = 1 second

forward FixPlayerMoney(playerid);

public OnFilterScriptInit() {
    print("\n-=[ fixes.inc money fixer loaded! ]=-\n");
    return 1;
}
public FixPlayerMoney(playerid) {
    if(playerMoneyValues[playerid] && (playerMoneyValues[playerid] != 0)) {
        GivePlayerMoney(playerid, playerMoneyValues[playerid]);
    }
    return 1;
}
public OnPlayerSpawn(playerid) {
    SetTimerEx("FixPlayerMoney", moneyFixDelay, false, "i", playerid);
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason) {
    playerMoneyValues[playerid] = GetPlayerMoney(playerid);
    return 1;
}
public OnPlayerDisconnect(playerid, reason) {
    playerMoneyValues[playerid] = 0;
    return 1;
}
public OnFilterScriptExit() {
    print("\n-=[ fixes.inc money fixer unloaded! ]=-\n");
    return 1;
}
Save it as filterscripts/fixes-inc-money-fixer.pwn, and compile it.
Now open your server.cfg file, find the filterscripts line and add fixes-inc-money-fixer too the end of it. Save and close the server.cfg file, start your server, go test.

If it works, hooray, if it doesn't work, try finetune the moneyFixDelay value at the top of the script
Reply
#7

He doesn't need that, he already established the issue is with fixes.inc.
Reply
#8

Quote:
Originally Posted by Abagail
Посмотреть сообщение
He doesn't need that, he already established the issue is with fixes.inc.
He said:
Quote:
Originally Posted by b3nz
Посмотреть сообщение
Does anybody have an idea how to fix this without deleting the library?
And what i posted is my idea
Reply
#9

Thanks everyone! L&A this.
Reply
#10

If the fix worked, and nobody is responding too the issue i the fixes.inc thread, maybe post the code i gave you too that thread, so it can help others too
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)