30.01.2015, 21:59
Hey, so when I fall some where to the ground, before the spawn protection ends, the Anti Cheat kicks me after Spawn Protection ends:
Under OnPlayerUpdate:
OnPlayerSpawn:
Under OnPlayerUpdate:
pawn Код:
new Float:pHealth;
GetPlayerHealth(playerid, pHealth);
new hacker[MAX_PLAYER_NAME];
GetPlayerName(playerid, hacker, MAX_PLAYER_NAME);
if(pHealth > 99)
{
if(Freemod[playerid] == 0 && OnDuty[playerid] == 0 && Spawnprotection[playerid] == 0)
{
new antimsg[128];
format(antimsg, sizeof(antimsg), "%s (%d) Has Been Kicked By The Anti-Cheat (AC) | Reason: Health Hacks.", hacker, playerid);
SendClientMessageToAll(0x00FFFFFF, antimsg);
SendClientMessage(playerid, 0xFF0000AA, "You Have Been Kicked By The Anti-Cheat (AC) | Reason: Health Hacks.");
SetTimerEx("TimeKicker", 500, false, "d", playerid);
}
}
pawn Код:
public OnPlayerSpawn(playerid)
{
Delete3DTextLabel(alabel[playerid]);
SendClientMessage(playerid,0xFF66FFAA,"Welcome To LSGW! If you are new here, see those commands: /cmds /rules /help /updates /credits.");
StopAudioStreamForPlayer(playerid); // Stop the audio stream
Freemod[playerid] = 0;
gangwarmod[playerid] = 1;
drylakemod[playerid] = 0;
AntiHealthSpam[playerid] = 0;
IsSongPlaying[playerid] = 0;
OnDuty[playerid] = 0;
Killstreak[playerid] = 0;
LSFreemod[playerid] = 0;
LVFreemod[playerid] = 0;
LVFreemod2[playerid] = 0;
Spawnprotection[playerid] = 1;
TextDrawShowForPlayer(playerid, Textdraw2);
PlayerTextDrawShow(playerid, Textdraw000[playerid]);
PlayerTextDrawShow(playerid, Textdraw111[playerid]);
PlayerTextDrawShow(playerid, Textdraw222[playerid]);
PlayerTextDrawShow(playerid, Textdraw333[playerid]);
PlayerTextDrawShow(playerid, Textdraw444[playerid]);
TextDrawShowForPlayer(playerid, Textdraw555);
SetPlayerHealth(playerid, 100);
if(playerfreezed[playerid] == 1)
{
TogglePlayerControllable(playerid, 0);
}
else if(playerfreezed[playerid] == 0)
{
TogglePlayerControllable(playerid, 1);
}
if(Info[playerid][VIPLevel] >= 1)
{
if(Info[playerid][Favouriteskin] > -1 || Info[playerid][Favouriteskin] < 299)
{
if(Autouseskin[playerid] == 1)
{
SetPlayerSkin(playerid, Info[playerid][Favouriteskin]);
SendClientMessage(playerid, 0x00FFFFFF, "Your Skin Has Been Changed To Your Favourite Skin! If You Want To Use It Manually, Do /useskin.");
}
}
}
new HouseID;
// Reset the HouseID where the player is located
APlayerData[playerid][CurrentHouse] = 0;
// If SpawnAtHouse is set to "true", re-position the player at the first house in his list of owned houses
if (SpawnAtHouse == true)
{
// Get the first HouseID in your list of owned houses
HouseID = APlayerData[playerid][Houses][0];
// Check if the player has a house in this first slot
if (HouseID != 0)
{
// Re-position the player at the house's coordinates
SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]);
}
}
if(IsSpecing[playerid] == 1)
{
SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// Remember earlier we stored the positions in these variables, now we're gonna get them from the variables.
SetPlayerInterior(playerid,Inter[playerid]);//Setting the player's interior to when they typed '/spec'
SetPlayerVirtualWorld(playerid,vWorld[playerid]);//Setting the player's virtual world to when they typed '/spec'
IsSpecing[playerid] = 0;//Just saying you're free to use '/spec' again YAY :D
IsBeingSpeced[spectatorid[playerid]] = 0;//Just saying that the player who was being spectated, is not free from your stalking >:D
}
ClearAnimations(playerid);
new world = random(40);
SetPlayerVirtualWorld(playerid, world);
if(world == 0)
{
SetPlayerVirtualWorld(playerid, 50);
}
SetPlayerHealth(playerid, 99999999);
Spawntimer[playerid] = SetTimerEx("Spawnprotect", 5000, false, "d", playerid);
SendClientMessage(playerid, -1, "You are under spawn protection for 5 seconds.");
GameTextForPlayer(playerid, "~g~Spawn Protection On", 3000, 4);
TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
TextDrawShowForPlayer(playerid,Text:R_1[playerid]);
return 1;
}