How to detect if a player gets a stunt bonus
#3

There's no other possible way for a player to gain client-side money while in a vehicle, as there's only stunt bonuses and casinos (and you're not in a vehicle in a casino), so you should just be able to detect a client-side cash increase by storing the last value in a variable and running a timer of about a second.

pawn Code:
new pOldCash[MAX_PLAYERS];

// Inside your GivePlayerCash or whatever function (or hook GivePlayerMoney):
pOldCash[playerid] = cash;

// in some timer
new newcash = GetPlayerCash/Money/Whatever(playerid/i);
new oldcash = pOldCash[playerid/i];
if(newcash > oldcash && IsPlayerInAnyVehicle(playerid/i)) // Gained money and it wasn't serverside
{
    new szStunt[64];
    format(szStunt, sizeof(szStunt), "Stunt Bonus: $%i", newcash-oldcash);
    SendClientMessage(playerid, -1, szStunt);
}
Blah. Roughly what you need to do. They could be a hacker though.
Reply


Messages In This Thread
How to detect if a player gets a stunt bonus - by stormchaser206 - 07.07.2012, 17:06
Respuesta: How to detect if a player gets a stunt bonus - by Chris1337 - 07.07.2012, 17:10
Re: How to detect if a player gets a stunt bonus - by MP2 - 07.07.2012, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)