RemoveBuildingForPlayer game freeze on restart
#2

Simple solution:

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

new
    bool:gAlreadyHandled[MAX_PLAYERS];

// Use this if you don't load the FS when you start your server.
public OnFilterScriptInit()
{
    for (new i = 0; i != MAX_PLAYERS; ++i)
    {
        if (IsPlayerConnected(i)) OnPlayerConnect(i);
    }
}

public OnGameModeInit()
{
    for (new i = 0; i != MAX_PLAYERS; ++i)
    {
        if (IsPlayerConnected(i)) gAlreadyHandled[i] = true;
    }
}

public OnPlayerConnect(playerid)
{
    if (gAlreadyHandled[playerid]) return 1;
    gAlreadyHandled[playerid] = true;
    // ================================
    //  Do your building removal here.
    // ================================
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    gAlreadyHandled[playerid] = false;
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)