"re"-define BasicFonction
#1

Hi all,

Today I've think about trying to make my own little anti-cheat. This Anticheat consist in, if player (for example) use SetPlayerHealth with a cheat system, ban him. So, I've thinking about redefine this fonction, such as:

pawn Код:
#define securemoney GivePlayerMoney
#define secureweapon GivePlayerWeapon
...
As you can see, this is call the same basic fonction but with an other name, should it work?
An Exemple for securemoney:

pawn Код:
if(GivePlayerMoney(playerid, > 0))
        {
            SendClientMessage(playerid, COLOR_RED, "Vous avez йtй banni pour cheat argent");
            SendClientMessage(playerid, COLOR_RED, "Si vous pensez qu'il s'agit d'une erreur, veuillez screener cette page et poster sur notre forum");
            SendClientMessage(playerid, COLOR_RED, "PS: Il est inutile de poster si vous avez rйellement cheat argent");
            Ban(playerid);
            format(string, sizeof(string), "[R2D2]: %s a йtй banni du serveur pour cheat argent", playerid);
            SendClientMessageToAll(COLOR_LIGHTRED, string);
            PlayerInfo[playerid][pLocked] = 1;
            return 1;
        }
The code before will ban the player if he call the basic "GivePlayerMoney" fonction, but let's see this code:

pawn Код:
if(strcmp(cmd, "/moneytest", true)==0)
{
      securemoney(playerid, 10000);
      return 1;
}
Will this code, the player will be banned or not?

Sorry but I don't know how to explain it... I think player will be banned in all examples, but I prefer to ask.






Thank's,
Sreadon.
Reply


Messages In This Thread
"re"-define BasicFonction - by Sreadon - 17.09.2011, 18:13
Re: "re"-define BasicFonction - by JaTochNietDan - 17.09.2011, 18:17
Re: "re"-define BasicFonction - by [MWR]Blood - 17.09.2011, 18:17
Re : "re"-define BasicFonction - by Sreadon - 17.09.2011, 18:19
Re: "re"-define BasicFonction - by Tigerkiller - 17.09.2011, 18:39
Re: "re"-define BasicFonction - by TheArcher - 17.09.2011, 19:28

Forum Jump:


Users browsing this thread: 2 Guest(s)