Timer vs OnPlayerUpdate
#4

OnPlayerUpdate is called almost 90 times per second, it should be used only for anti cheat purposes. It may kill the server if it's used incorrectly. A timer will be more efficient to make things like speedometers or more.

I'll give you some examples of what you could use OnPlayerUpdate.
pawn Код:
public OnPlayerUpdate(playerid)
{
      SendClientMessage(playerid, 0x33CC33FF, "SPAM");//This will spam the chat box. Don't do it.
      GameTextForPlayer(playerid, "SPAM", 3000, 4);//This will make a gametext stay forever. Don't do it
      ...//You can have more ideas, BUT, it can be used for anti cheating purposes.. example:
    if(GetPlayerWeapon(playerid) == 38 && !IsPlayerAdmin(playerid))//Anti minigun
    {
        new msg[128], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(msg, sizeof(msg), "%s (%i) was banned for using cheats.", pname, playerid);
        BanEx(playerid, msg);
    }

      return 1;
}
Reply


Messages In This Thread
Timer vs OnPlayerUpdate - by PrO.GameR - 18.10.2015, 21:33
Re: Timer vs OnPlayerUpdate - by Vince - 18.10.2015, 22:52
Re: Timer vs OnPlayerUpdate - by PrO.GameR - 19.10.2015, 09:43
Respuesta: Timer vs OnPlayerUpdate - by xXmAn40100Xx - 20.10.2015, 01:24

Forum Jump:


Users browsing this thread: 1 Guest(s)