24.07.2015, 15:28
big functions like this on OnPlayerUpdate might lag the server?
PHP код:
new Float:playerarmour;
GetPlayerArmour(playerid,playerarmour);
if(playerarmour>98){
format(String,sizeof(String),"[GameGuard] {ff7777}%s has been ip banned, reason: Cheat Detected (#Code 47)",GetName(playerid));
MSGTA(C_RED,String);
TogglePlayerControllable(playerid,0);
new Year2,Month2,Day2,Hour2,Minute2,Second2;
gettime(Hour2,Minute2,Second2);
getdate(Day2,Month2,Year2);
format(String,sizeof(String),"{ff0000}You've banned from the server!\n{FFFFFF}Admin: GameGuard\nReason: %s\nTime: %i:%i:%i\nDate: %i/%i/%i",String2,Hour2,Minute2,Second2,Year2,Month2,Day2);
DLG(param[0],999,DIALOG_STYLE_MSGBOX,"{ff0000}IP Ban",String,"Close","");
GetPlayerIp(playerid,PIP,sizeof(PIP));
format(BanipDB[playerid][IPAddress],16,PIP);
format(BanipDB[playerid][Admin],MAX_PLAYER_NAME,"GameGuard");
format(BanipDB[playerid][Reason],256,"Armour Hack");
BanipDB[playerid][Second]=Second2;
BanipDB[playerid][Minute]=Minute2;
BanipDB[playerid][Hour]=Hour2;
BanipDB[playerid][Day]=Day2;
BanipDB[playerid][Month]=Month2;
BanipDB[playerid][Year]=Year2;
SaveBanipFile(playerid);
GameTextForPlayer(playerid, "~R~Banned", 99999, 0);
KickPlayer(playerid);}