06.09.2013, 23:02
Thanks, this tutorial is the best! UP!
forward MoneyTimer();
public MoneyTimer()
{
new username[MAX_PLAYER_NAME];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerCash(i) != GetPlayerMoney(i))
{
ResetMoneyBar(i);
UpdateMoneyBar(i,GetPlayerCash(i));
new hack = GetPlayerMoney(i) - GetPlayerCash(i);
GetPlayerName(i,username,sizeof(username));
printf("%s has picked up/attempted to spawn $%d.", username,hack);
}
if(PlayerInfo[i][Level] > 0)
{
new stringss[256];
new hack = GetPlayerMoney(i) - GetPlayerCash(i);
format(stringss, sizeof(stringss), "[Money Hack] : %s has spawned $%d", username, hack);
SendClientMessage(playerid,COLOR_PURPLE,stringss);
}
}
}
}
for(new playerid;playerid<MAX_PLAYERS;playerid++)
SOLVED !
PHP Code:
|
SendClientMessage(playerid,COLOR_PURPLE,stringss);
SendClientMessage(i,COLOR_PURPLE,stringss);
#if !defined AC_MONEY__IGNORE_TIME
#define AC_MONEY__IGNORE_TIME (1000)
#endif
static ac_money[MAX_PLAYERS], ac_money__ignore_tick[MAX_PLAYERS];
#if !defined U_ANTI_MONEY_HACK_TROLL_MODE
@u_anti_money_hack_Timer();
@u_anti_money_hack_Timer(){
#if (defined foreach) && (defined Player@YSII_Ag)
foreach (new i:Player)
#else
for (new i = GetPlayerPoolSize() + 1; i-- != 0; ) if (IsPlayerConnected(i))
#endif
{
if (ac_money[i] != GetPlayerMoney(i)){
if ((ac_money[i] > GetPlayerMoney(i))
&& (GetTickCount() > ac_money__ignore_tick[i])){
ac_money[i] = GetPlayerMoney(i);
}
else if (ac_money[i] < GetPlayerMoney(i)){
ResetPlayerMoney(i);
GivePlayerMoney(i, ac_money[i]);
#if defined OnMoneyCheatDetected
OnMoneyCheatDetected(i);
#endif
return 0;
}
}
}
return 1;
}
public OnGameModeInit(){
SetTimer("@u_anti_money_hack_Timer", 1000, true);
#if defined ac_money__OnGameModeInit
return ac_money__OnGameModeInit();
#else
return 1;
#endif
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#if defined ac_money__OnGameModeInit
forward ac_money__OnGameModeInit();
#endif
#define OnGameModeInit ac_money__OnGameModeInit
public OnFilterScriptInit(){
SetTimer("@u_anti_money_hack_Timer", 1000, true);
#if defined ac_money__OnFilterScriptInit
return ac_money__OnFilterScriptInit();
#else
return 1;
#endif
}
#if defined _ALS_OnFilterScriptInit
#undef OnFilterScriptInit
#else
#define _ALS_OnFilterScriptInit
#endif
#if defined ac_money__OnFilterScriptInit
forward ac_money__OnFilterScriptInit();
#endif
#define OnFilterScriptInit ac_money__OnGameModeInit
#endif
public OnPlayerConnect(playerid){
ac_money[playerid] = ac_money__ignore_tick[playerid] = 0;
#if defined ac_money__OnPlayerConnect
return ac_money__OnPlayerConnect(playerid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#if defined ac_money__OnPlayerConnect
forward ac_money__OnPlayerConnect(playerid);
#endif
#define OnPlayerConnect ac_money__OnPlayerConnect
stock ac_money__GivePlayerMoney(playerid, money){
ac_money__ignore_tick[playerid] = GetTickCount() + AC_MONEY__IGNORE_TIME;
ac_money[playerid] = money;
return GivePlayerMoney(playerid, money);
}
#if defined _ALS_GivePlayerMoney
#undef GivePlayerMoney
#else
#define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney ac_money__GivePlayerMoney
static stock u_ac_money__CheckPlayerMoney(playerid){
if (ac_money[playerid] != GetPlayerMoney(playerid)){
if ((ac_money[playerid] > GetPlayerMoney(playerid))
&& (GetTickCount() > ac_money__ignore_tick[playerid])){
ac_money[playerid] = GetPlayerMoney(playerid);
}
else if (ac_money[playerid] < GetPlayerMoney(playerid)){
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, ac_money[playerid]);
return 0;
}
}
return 1;
}
stock ac_money__GetPlayerMoney(playerid){
#if defined U_ANTI_MONEY_HACK_TROLL_MODE
if (u_ac_money__CheckPlayerMoney(playerid)){
#if defined OnMoneyCheatDetected
OnMoneyCheatDetected(playerid);
#endif
return 0;
}
#endif
return ac_money[playerid];
}
#if defined _ALS_GetPlayerMoney
#undef GetPlayerMoney
#else
#define _ALS_GetPlayerMoney
#endif
#define GetPlayerMoney ac_money__GetPlayerMoney
stock ac_money__ResetPlayerMoney(playerid){
ac_money__ignore_tick[playerid] = GetTickCount() + AC_MONEY__IGNORE_TIME;
ac_money[playerid] = 0;
return 1;
}
#if defined _ALS_ResetPlayerMoney
#undef ResetPlayerMoney
#else
#define _ALS_ResetPlayerMoney
#endif
#define ResetPlayerMoney ac_money__ResetPlayerMoney
#if defined OnMoneyCheatDetected
forward OnMoneyCheatDetected(playerid);
#endif
public MoneyTimer() { new username[MAX_PLAYER_NAME]; for(new i=0; i<MAX_PLAYE.... |