25.01.2015, 12:48
Код:
public OnPlayerUpdate(playerid) { new animName[32], animLib[32], Float:playerGPos[MAX_PLAYERS][3]; GetAnimationName(GetPlayerAnimationIndex(playerid), animLib, sizeof(animLib), animName, sizeof(animName)); GetPlayerPos(playerid, playerGPos[playerid][0], playerGPos[playerid][1], playerGPos[playerid][2]); if(strcmp(animLib, "SWIM", false) || playerGPos[playerid][2] <= 1.5) OnPlayerSwim(playerid, PLAYER_SWIM); else OnPlayerSwim(playerid, PLAYER_HACK); } public OnPlayerSwim(playerid, status) { switch(status) { case PLAYER_SWIM: { } case PLAYER_HACK: { { new Float:animX, Float:animY, Float:animZ; new aNim = GetPlayerAnimationIndex(playerid); GetPlayerPos(playerid, animX, animY, animZ); if((aNim >= 1538) && (aNim <= 1542) && animZ > 5) { if(!IsPlayerInRangeOfPoint(playerid, 50.0,2021.3466,1673.1593,8.0484) || !IsPlayerInRangeOfPoint(playerid, 50.0,2143.2383,1285.6169,7.9766 )|| !IsPlayerInRangeOfPoint(playerid, 50.0,2101.0918,1910.8403,9.0792 )) { if(hacker[playerid] ==0) { SendClientMessage(playerid, COLOR_YELLOW, "You have been banned from the server. Reason: Sobiet Fly Hack"); format(Jstring, 128, "Bot : %s has been banned from the server. Reason: Sobiet Fly Hack", GetName(playerid)); SendClientMessageToAll(COLOR_KRED, Jstring); hacker[playerid] =1; SetTimerEx("BP",10,false,"d", playerid); } }}}}} return 1; } stock IsPlayerInWater(playerid) { new anim = GetPlayerAnimationIndex(playerid); if (((anim >= 1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;