Players connect, server crashes
#8

I can't post my OnPlayerConnect since it's over 1000 lines long however, it wouldn't be the reason because the other dozens of players connect smoothly.
pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[], success )
{
    if( !success )
        return ShowErrorMessage( playerid, "Unknown command, type /help or /helpme." );

    else
    {
        if( strcmp( cmdtext, "/me", true ) != 0 || strcmp( cmdtext, "/do", true ) != 0)
            CommandTime[playerid] = 0;
        else if( strcmp( cmdtext, "/ban", true ) == 0)
            CommandTime[playerid] = 7;
        else CommandTime[playerid] = 1;

        UncheckedPays[playerid] = 0;
        format( szString, 128, "%s typed \"%s\"", GetPName( playerid ), cmdtext );
        Log( szString, LOGTYPE_CMD );
    }

    return 1;
}

public OnPlayerCommandReceived( playerid, cmdtext[] )
{
    if( PlayerInfo[playerid][LoggedIn] == 0) return 1;
    if( CommandTime[playerid] != 0) {
        format( szString, 128, "There are %d seconds left before you can perform another command.", CommandTime[playerid] );
        ShowErrorMessage( playerid, szString );
        return 0;
    }

    return 1;
}

stock Log( logString[], logType )
{
    new logPath[128], fileEntry[128];

    switch( logType ) {
        case LOGTYPE_DEATH: logPath = DeathLogPath;
        case LOGTYPE_BAN: logPath = BanLogPath;
        case LOGTYPE_KICK: logPath = KickLogPath;
        case LOGTYPE_AJAIL: logPath = AdminJailLogPath;
        case LOGTYPE_CMD: logPath = UserCommandLogPath;
        case LOGTYPE_ADMCMD: logPath = AdmCommandLogPath;
        case LOGTYPE_PM: logPath = PMLogPath;
        case LOGTYPE_PAY: logPath = PayLogPath;
        case LOGTYPE_PURCHASE: logPath = PurchasesLogPath;
        case LOGTYPE_ICCHAT: logPath = ICChatLogPath;
        case LOGTYPE_OOCCHAT: logPath = OOCChatLogPath;
        case LOGTYPE_ACTIONS: logPath = ActionLogPath;
        case LOGTYPE_WEAPONRY: logPath = WeaponryLogPath;
    }

    new day, month, year;
    new timesec, timemin, timehour;
    getdate( year, month, day );
    gettime( timehour, timemin, timesec );
    format( fileEntry, 128, "[%d/%d/%d] [%d:%d:%d] %s\r\n", day, month, year, timehour, timemin, timesec, logString );

    new File: logFile;
    logFile = fopen( logPath, io_append );
    fwrite( logFile, fileEntry );
    fclose( logFile );

    return 1;
}
Reply


Messages In This Thread
Players connect, server crashes - by admantis - 03.07.2012, 20:33
Respuesta: Players connect, server crashes - by admantis - 04.07.2012, 02:04
Re: Players connect, server crashes - by SnG.Scot_MisCuDI - 04.07.2012, 03:00
Re: Players connect, server crashes - by Dubya - 04.07.2012, 03:17
Re: Players connect, server crashes - by ZBits - 04.07.2012, 08:45
Re: Players connect, server crashes - by Cronic - 04.07.2012, 11:21
Re: Players connect, server crashes - by Cronic - 04.07.2012, 11:36
Respuesta: Players connect, server crashes - by admantis - 04.07.2012, 15:31

Forum Jump:


Users browsing this thread: 1 Guest(s)