if(strcmp(cmd, "/test", true)==0) { if(IsPlayerLAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /test [ID]"); return 1; } new pid = strval(tmp); if (IsPlayerConnected(pid)) { storeint[pid] = GetPlayerInterior(playerid); GetPlayerPos(pid, Floattorex[playerid], Floattorey[playerid], Floattorez[playerid]); SetPlayerPos(pid,-1128.5248,835.2584,3.077; SetPlayerHealth(pid,10); OldHealth = GetPlayerHealth(pid,Health); TogglePlayerControllable(pid,0); BeingTested[pid] = 1; SetTimer("HealthTest", 6000, 0); return 1; } } return 1; } |
forward HealthTest(); public HealthTest() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(BeingTested[i] == 1) { BeingTested[i] = 0; GetPlayerHealth(i,Health); if(Health > OldHealth) { new string [256]; new pName[MAX_PLAYER_NAME]; GetPlayerName(i, pName, sizeof(pName)); format(string, sizeof(string), "%s was kicked due to health cheats", pName); SendClientMessageToAll(0x33CCFFAA, string); Kick(i); SaveToFile("KickLog",string); } else if(Health == OldHealth) { new string [256]; new pName[MAX_PLAYER_NAME]; GetPlayerName(i, pName, sizeof(pName)); format(string, sizeof(string), "%s is not cheating.", pName); SendClientMessageToAll(0x33CCFFAA, string); SetPlayerHealth(i,100); SetPlayerInterior(i, storeint[i]); DOO_SetPlayerPos(i, storex[i],storey[i],storez[i]); TogglePlayerControllable(i,1); } } } } return 1; |
new Float:Health[MAX_PLAYERS];