When someone types the server crashes
#1

Anyone knows whats wrong?
I dont get any errors in server_log to.
Tell me when you need to see something or so...
Reply
#2

Show us your OnPlayerText.











This forum requires that you wait 120 seconds between posts. Please try again in 86 seconds.


FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU---------------
Reply
#3

pawn Code:
public OnPlayerText(playerid, text[])
{
    new str[128];
    if(PlayerStat[playerid][Logged] == 0)
    {
        SendClientMessage(playerid, GREY, "You must be logged in.");
        return 0;
    }
    if(Server[CurrentGMX] >= 1)
    {
        SendClientMessage(playerid, GREY, "Please wait untill the server has fully restarted.");
        return 0;
    }
    if(PlayerStat[playerid][FullyRegistered] == 0)
    {
        SendClientMessage(playerid, GREY, "You must enter your character information to chat.");
        return 0;
    }
    if(PlayerStat[playerid][Spawned] == 0)
    {
        SendClientMessage(playerid, GREY, "You must be spawned to chat.");
        return 0;
    }
    if(PlayerStat[playerid][Muted] == 1)
    {
        format(str, sizeof(str), "You can't chat while you're muted, you must wait %d seconds.", PlayerStat[playerid][MuteTime]);
        SendClientMessage(playerid, GREY, str);
        return 0;
    }
    else
    {
        format(str, sizeof(str), "%s says [%s Accent]: %s", GetICName(playerid), PlayerStat[playerid][Accent], text);
        SendNearByMessage(playerid, WHITE, str, 5);
        ICLog(str);
        new Length = strlen(text);
        new TalkTime = Length*100;
        ApplyAnimation(playerid,"PED","IDLE_chat", 4.1, 0, 1, 1, 0, TalkTime);
        KillTimer(Server[StopTalkingAnimation]);
        Server[StopTalkingAnimation] = SetTimerEx("StopTalkingAnim", TalkTime, 0, "d", playerid);
    }
    return 0;
}

public StopTalkingAnim(playerid)
{
    StopLoopingAnimation(playerid);
    return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(PlayerStat[playerid][Logged] == 0)
    {
        SendClientMessage(playerid, GREY, "You must be logged in.");
        return 0;
    }
    if(Server[CurrentGMX] >= 1)
    {
        SendClientMessage(playerid, GREY, "Please wait untill the server has fully restarted.");
        return 0;
    }
    if(PlayerStat[playerid][FullyRegistered] == 0)
    {
        SendClientMessage(playerid, GREY, "You must enter your character information before using commands.");
        return 0;
    }
    if(PlayerStat[playerid][Spawned] == 0)
    {
        SendClientMessage(playerid, GREY, "You must be spawned.");
        return 0;
    }
    if(PlayerStat[playerid][Muted] == 1)
    {
        new str[128];
        format(str, sizeof(str), "You can't use commands while you're muted, you must wait %d seconds.", PlayerStat[playerid][MuteTime]);
        SendClientMessage(playerid, GREY, str);
        return 0;
    }
    else return 1;
}
Reply
#4

Varies much i guess.... if ICLog write/reads from a file that could be causing the sevrer crashes...

also maybe ApplyAnimation(playerid,"PED","IDLE_chat", 4.1, 0, 1, 1, 0, TalkTime); has something invalid in it(btw i dont use animations so idk what is valid or not)...

SendNearByMessage could be causing it depending on how its coded there...

Server[StopTalkingAnimation]... hmmm....this sounds strange idk if its possible doing arrays with names(unless you define them or use ENUM)

StopLoopingAnimation could be causing it too depends...

your OnPlayerCommandReceived looks clean also idk why u posted it but ok...

i also see nothing wrong with the stuff before "else" on OnPlayerText, they see clean... i cant try it in my script because i dont have the functions, sry. cant help more
Reply
#5

Anyone else?
Reply
#6

Help?
Reply
#7

you must have a %s with no reference...

like

pawn Code:
format(string, size,"%s Says: %s %s",Name, result);
sometimes this shut the server down...(it happens with me)
Reply
#8

I dont get it... ?
Where do i put that thing then?
Reply
#9

I really need some help. Anyone?
Reply
#10

pawn Code:
public OnPlayerText(playerid, text[])
{
    if (!text [0])
        return 0;

    new str[128];
    if(PlayerStat[playerid][Logged] == 0)
    {
        SendClientMessage(playerid, GREY, "You must be logged in.");
        return 0;
    }
    if(Server[CurrentGMX] >= 1)
    {
        SendClientMessage(playerid, GREY, "Please wait untill the server has fully restarted.");
        return 0;
    }
    if(PlayerStat[playerid][FullyRegistered] == 0)
    {
        SendClientMessage(playerid, GREY, "You must enter your character information to chat.");
        return 0;
    }
    if(PlayerStat[playerid][Spawned] == 0)
    {
        SendClientMessage(playerid, GREY, "You must be spawned to chat.");
        return 0;
    }
    if(PlayerStat[playerid][Muted] == 1)
    {
        format(str, sizeof(str), "You can't chat while you're muted, you must wait %d seconds.", PlayerStat[playerid][MuteTime]);
        SendClientMessage(playerid, GREY, str);
        return 0;
    }
    else
    {
        format(str, sizeof(str), "%s says [%s Accent]: %s", GetICName(playerid), PlayerStat[playerid][Accent], text);
        SendNearByMessage(playerid, WHITE, str, 5);
        ICLog(str);
        new Length = strlen(text);
        new TalkTime = Length*100;
        ApplyAnimation(playerid,"PED","IDLE_chat", 4.1, 0, 1, 1, 0, TalkTime);
        KillTimer(Server[StopTalkingAnimation]);
        Server[StopTalkingAnimation] = SetTimerEx("StopTalkingAnim", TalkTime, 0, "d", playerid);
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)