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

Hello,
How can you detect if a player gets a stunt bonus? I need it cause I am making a stunt server.
Thanks
Reply
#2

basically , you cant as is a Game client stuff. You can detect when a player changes his z coordinate , if it increases and gets money in that second , then you could print that they have make a stunt
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)