28.10.2011, 20:47
Trying to make a money anticheat.
But in-game the cash variable exists, but the money doesn't show in the hud.
Any ideas?
pawn Код:
public GetMoney()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new money = GetPlayerMoney(i);
if(PlayerInfo[i][pCash] > money) // if the server money are more than the server given money
{
ResetPlayerMoney(i);
GivePlayerMoney(i, PlayerInfo[i][pCash]);
}
else if(PlayerInfo[i][pCash] < money) // if the game money are lower than the server-given money
{
ResetPlayerMoney(i);
GivePlayerMoney(i, PlayerInfo[i][pCash]);
}
}
}
return ;
}
Any ideas?