PDA

View Full Version : When someone types the server crashes


Sensitive
01/10/2011, 10:00 PM
Anyone knows whats wrong?
I dont get any errors in server_log to.
Tell me when you need to see something or so...

henry jiggy
01/10/2011, 10:08 PM
Show us your OnPlayerText.











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


FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU---------------

Sensitive
01/10/2011, 10:24 PM
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;
}

henry jiggy
01/10/2011, 10:39 PM
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

Sensitive
01/10/2011, 10:56 PM
Anyone else?

Sensitive
02/10/2011, 08:24 AM
Help?

Pharrel
02/10/2011, 08:26 AM
you must have a %s with no reference...

like

format(string, size,"%s Says: %s %s",Name, result);

sometimes this shut the server down...(it happens with me)

Sensitive
02/10/2011, 08:29 AM
I dont get it... ?
Where do i put that thing then?

Sensitive
02/10/2011, 08:39 AM
I really need some help. Anyone?

Double-O-Seven
02/10/2011, 08:41 AM
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;
}

Sensitive
02/10/2011, 08:45 AM
Still :(

Pharrel
02/10/2011, 08:57 AM
public OnPlayerText(playerid, text[])
{
new str[128];
if(PlayerStat[playerid][Logged] == 0)
SendClientMessage(playerid, GREY, "You must be logged in.");
else if(Server[CurrentGMX] >= 1)
SendClientMessage(playerid, GREY, "Please wait untill the server has fully restarted.");
else if(PlayerStat[playerid][FullyRegistered] == 0)
SendClientMessage(playerid, GREY, "You must enter your character information to chat.");
else if(PlayerStat[playerid][Spawned] == 0)
SendClientMessage(playerid, GREY, "You must be spawned to chat.");
else 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);
}
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);//if you're using talktime here why use a timer?
//KillTimer(Server[StopTalkingAnimation]);
//Server[StopTalkingAnimation] = SetTimerEx("StopTalkingAnim", TalkTime, 0, "d", playerid);
}
return 0;
}

show your public ICLog

Sensitive
02/10/2011, 09:14 AM
Where can i find the ICLog?

Pharrel
02/10/2011, 09:20 AM
ctrl+f stock iclog or
ctrl_f public iclog