Server Crashes
#1

Hi,
Everytime I write something in my server
(T- blabla - Enter) my server crashes.
It just stops/exits, without any error or something.

Any idea? /commands works.
pawn Код:
public OnPlayerText(playerid, text[])
{
    ServerInfo[TotText] ++;
    dini_IntSet(SFile, "MessagesSent", ServerInfo[TotText]);
    new playrname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playrname, sizeof(playrname));
    new chat[256], second, minute, hour;
    gettime(hour,minute,second);
    format(chat, sizeof(chat), "\n[%d:%d:%d]%s: %s", hour, minute, second, playrname, text);
    ChatLog(chat);
    SpamStrings[playerid] ++;
    if(SpamStrings[playerid] >= MAX_SPAM)
    {
        switch (Lang[playerid])
        {
            case 0:
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "TEXT LIMIT EXCEEDED - Please wait before talking again !");
                return 0;
            }
            case 1:
            {
            }
        }
    }
    if(Muted[playerid] == 1)
    {
        switch (Lang[playerid])
        {
            case 0:
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't talk, you are Muted !");
                return 0;
            }


        }
        SendClientMessage(playerid, COLOR_BRIGHTRED, "You are Muted !");
        return 0;
    }
    if(ServerInfo[ChatLocked] == 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
        switch (Lang[playerid])
        {
            case 0:
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't talk, the chat is Locked !");
                return 0;
            }

        }
    }
    if(strcmp(text, "login", true,5) == 0)
    {
        return 0;
    }
    return 1;
}
Reply
#2

You have some bug in your OnPlayerText then. Maybe an array index out of bounds or so. Go through it and try to find anything unusual.
Reply
#3

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
You have some bug in your OnPlayerText then. Maybe an array index out of bounds or so. Go through it and try to find anything unusual.
pawn Код:
public OnPlayerText(playerid, text[])
{
    ServerInfo[TotText] ++;
    dini_IntSet(SFile, "MessagesSent", ServerInfo[TotText]);
    new playrname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playrname, sizeof(playrname));
    new chat[256], second, minute, hour;
    gettime(hour,minute,second);
    format(chat, sizeof(chat), "\n[%d:%d:%d]%s: %s", hour, minute, second, playrname, text);
    ChatLog(chat);
    SpamStrings[playerid] ++;
    if(SpamStrings[playerid] >= MAX_SPAM)
    {
        switch (Lang[playerid])
        {
            case 0:
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "TEXT LIMIT EXCEEDED - Please wait before talking again !");
                return 0;
            }
            case 1:
            {
            }
        }
    }
    if(Muted[playerid] == 1)
    {
        switch (Lang[playerid])
        {
            case 0:
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't talk, you are Muted !");
                return 0;
            }


        }
        SendClientMessage(playerid, COLOR_BRIGHTRED, "You are Muted !");
        return 0;
    }
    if(ServerInfo[ChatLocked] == 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
        switch (Lang[playerid])
        {
            case 0:
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't talk, the chat is Locked !");
                return 0;
            }

        }
    }
    if(strcmp(text, "login", true,5) == 0)
    {
        return 0;
    }
    return 1;
}
Can you see any? :-S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)