20.10.2015, 01:24
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.
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;
}