// Anti NPC spoof by [uL]Pottus

forward OnAntiCheatNPCSpoof(playerid);

public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new ip[16];
        GetPlayerIp(playerid, ip, sizeof(ip));
        if (!!strcmp(ip, "127.0.0.1"))
        {
            new name[MAX_PLAYER_NAME];
            format(name, sizeof(name), "%i", gettime());
            SetPlayerName(playerid, name);
            CallLocalFunction("OnAntiCheatNPCSpoof", "i", playerid);
            return 1;
        }
    }
    if (funcidx("AntiNPC_OnPlayerConnect") != -1)
    {
        return CallLocalFunction("AntiNPC_OnPlayerConnect", "i", playerid);
    }
    return 1;
}

#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect AntiNPC_OnPlayerConnect

forward AntiNPC_OnPlayerConnect(playerid);