Problem 100$ in OnPlayerDeath.
#1

Hello !

When a player death > The player loose 100$.

It's a "problem" in GTA.

I have an anticheat (call with OnPlayerUpdate), and it's a problem...

How to resolve this problem?

THX
Reply
#2

You literally need to give them $100 on death, it's unavoidable, perhaps a SAMP update will fix this.

Add

pawn Код:
GivePlayerMoney(playerid, 100);
Under OnPlayerDeath.
Reply
#3

Quote:
Originally Posted by Baltimore
Посмотреть сообщение
Hello !

When a player death > The player loose 100$.

It's a "problem" in GTA.

I have an anticheat (call with OnPlayerUpdate), and it's a problem...

How to resolve this problem?

THX
Example:

Player Stats - Server Side

PlayerMoney[playerid]

Player Stats - Client Side

Money = 1000

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    UpdateMoney(playerid);
}

stock UpdateMoney(playerid)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, PlayerMoney[playerid]);
}
Reply
#4

The anticheat banned before ..
Reply
#5

Can I see the code where you use a money check for the anti cheat?
Reply
#6

My timer:

pawn Код:
forward Anticheat_money(playerid);
public Anticheat_money(playerid)
{
    new string[144];

    if(GetPlayerMoney(playerid) != PlayerInfo[playerid][Cash])
    {
        SendClientMessage(playerid, -1, "Cheat money detected.");
       
        // Ban player.

        SetTimerEx("Player_kick", 500, 0, "d", playerid);
        return 1;
    }
    return 1;
}
Even from OnPlayerUpdate a timer in 1 second , it happens to be banned anyway ..
Reply
#7

pawn Код:
forward Anticheat_money(playerid);
public Anticheat_money(playerid)
{
    new string[144];

    if(GetPlayerMoney(playerid) != PlayerInfo[playerid][Cash] && PlayerDead[playerid] == 0)
    {
        SendClientMessage(playerid, -1, "Cheat money detected.");

        // Ban player.

        SetTimerEx("Player_kick", 500, 0, "d", playerid);
        return 1;
    }
    return 1;
}
Add PlayerDead[playerid] under OnPlayerDeath, That should make an exemption.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)