Античит
#2

pawn Код:
stock IsPlayerSpawn(playerid)
{
    return GetPVarInt(playerid, "IsSpawn") != 0;
}

stock SetPlayerSpawnStatus(playerid, status)
{
    SetPVarInt(playerid, "IsSpawn", status);
}

public OnPlayerSpawn(playerid)
{
    SetPlayerSpawnStatus(playerid, 1);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerSpawnStatus(playerid, 0);
    return 1;
}

public onCheckAirBrk(playerid)
{
    if (!IsPlayerSpawn(playerid)) {
        return 0;
    }
    new Float: AC::Pos[3], Float: distance;
    GetPlayerPos(playerid, AC::Pos[0], AC::Pos[1], AC::Pos[2]);
    distance = floatround(GetPlayerDistanceFromPoint(playerid, AC::Info[playerid][AC::Pos_X], AC::Info[playerid][AC::Pos_Y], AC::Info[playerid][AC::Pos_Z]));
    if(GetPVarInt(playerid, "Protect") == 0)
    {
        if(GetPlayerState(playerid) == 1)
        {
            if(distance > 40) CheatKick(playerid, "3");
        }
        else
        {
            if(distance > 80) CheatKick(playerid, "3");
        }
    }
    AC::Info[playerid][AC::Pos_X] = AC::Pos[0];
    AC::Info[playerid][AC::Pos_Y] = AC::Pos[1];
    AC::Info[playerid][AC::Pos_Z] = AC::Pos[2];
    if(GetTickCount() - AC::Info[playerid][AC::LastUpdate] > 2000) SetPVarInt(playerid, "Protect", 500);
    AC::Info[playerid][AC::LastUpdate] = GetTickCount();
    return 1;
}
Но как показала практика, вызов SetPlayerSpawnStatus(playerid, 1) лучше производить через некоторое время после вызова OnPlayerSpawn.
Reply


Messages In This Thread
Античит - by SanDev - 21.01.2015, 05:03
Re: Античит - by ZiGGi - 21.01.2015, 06:06
Re: Античит - by Mutha_X - 21.01.2015, 09:04
Re: Античит - by ZiGGi - 21.01.2015, 09:41
Re: Античит - by SanDev - 21.01.2015, 11:23
Re: Античит - by Stepashka - 21.01.2015, 11:28
Re: Античит - by SanDev - 21.01.2015, 11:37
Re: Античит - by SanDev - 21.01.2015, 11:41
Re: Античит - by Stepashka - 21.01.2015, 11:46
Re: Античит - by ZiGGi - 21.01.2015, 12:15
Re: Античит - by SanDev - 21.01.2015, 12:22
Re: Античит - by SanDev - 21.01.2015, 14:56
Re: Античит - by Jon_De - 21.01.2015, 16:46

Forum Jump:


Users browsing this thread: 2 Guest(s)