Server sided money
#1

If a hacker hack money it set it back where it was. how to do that server sided. I'm using Ini.
PlayerInfo[playerid][pCash].
Reply
#2

it shouldn't be checked on OnPlayerUpdate bcz it gets called too often, but here is the idea:

Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerMoney(playerid) != PlayerInfo[playerid][pCash])
    {
        GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
        GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
        
        // Player's a hacker, do whatever u want with him
    }
    
    return 1;
}
Reply
#3

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
If a hacker hack money it set it back where it was. how to do that server sided. I'm using Ini.
PlayerInfo[playerid][pCash].
There are basically two ways. One is to create a timer, which will refresh in, for example, 1000 miliseconds, and will reset player money (ResetPlayerMoney()) and set it back to PlayerInfo[playerid][pCash] (GivePlayerMoney(playerid, PlayerInfo[playerid][pCash])).

The second one:
Instead of:
pawn Код:
if( GetPlayerMoney(playerid) < 10 ) return SendClientMessage( playerid, -1, "You've less than $10..");
just do:
pawn Код:
if( PlayerInfo[playerid][pCash] < 10 ) return SendClientMessage( playerid, -1, "You've less than $10..");
Additionally, with this second one, before return You can reset player money and set it (as in 1st way) back to PlayerInfo[playerid][pCash].

Greetings.
Reply
#4

I mean only if the player hacked the money. but it's resting this one
GivePlayerMoney(playerid, trucker[End][cost]); i don't want it to reset this one.
Reply
#5

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
I mean only if the player hacked the money. but it's resting this one
GivePlayerMoney(playerid, trucker[End][cost]); i don't want it to reset this one.
Replace this with
Код:
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] +  trucker[End][cost];
after the timer comes back around the player will get the pay for the trucker job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)