13.09.2011, 04:18
Bom, estou tentando colocar um anti money hack no meu gamemode, sу que nгo achei nenhum funcional
alguйm poderia me indicar um?
alguйm poderia me indicar um?
#include <dini>
new Dinheiro[MAX_PLAYERS];
public OnGameModeInit()
{
if(!fexist("Dinheiro.txt")) dini_Create("Dinheiro.txt");
SetTimer("Check", 750, true);
return 1;
}
public OnPlayerConnect(playerid)
{
new sStr[MAX_PLAYER_NAME];
GetPlayerName(playerid, sStr, MAX_PLAYER_NAME);
ResetPlayerMoney(playerid);
Dinheiro[playerid] = dini_Int("Dinheiro.txt", sStr);
GivePlayerMoney(playerid, Dinheiro[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new sStr[MAX_PLAYER_NAME];
GetPlayerName(playerid, sStr, MAX_PLAYER_NAME);
dini_IntSet("Dinheiro.txt", sStr, Dinheiro[playerid]);
return 1;
}
forward Check();
public Check()
{
for(new i, p = GetMaxPlayers(); i < p; i ++)
{
if(!IsPlayerConnected(i) || Dinheiro[i] == GetPlayerMoney(i)) continue;
ResetPlayerMoney(i);
GivePlayerMoney(i, Dinheiro[i]);
}
return 1;
}
stock GivePlayerCash(playerid, money)
{
Dinheiro[playerid] += money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, Dinheiro[playerid]);
return 1;
}
stock ResetPlayerCash(playerid)
{
Dinheiro[playerid] = 0;
ResetPlayerMoney(playerid);
return 1;
}
stock GetPlayerCash(playerid) return Dinheiro[playerid];
PHP код:
|
SetTimer("Check", 750, true);