Server Disconnect when talking
#1

Server Disconnect when talking

if i type something and press enter, the server disconnects. and i have to turn it on again.
Why?
im using the LSRP gamemode. if i host it in my PC, it doesnt disconnects. it only happens to the host
Reply
#2

I tried 2 gamemodes, and it same result
when i use grand larceny, its works
Reply
#3

Did you unload your filterscripts too?

If you tried 2 GMs and get same problem it's probably a FS.


EDIT: One of your FS may try to open a file and (io_read) read it? If the destination of the file does not exist, the server will crash. Just a wild guess.
Reply
#4

Like the post above, unload all fa on start so then u would know what is crashing it
Reply
#5

I did unload all the filterscripts. and both of the GM crash. but grand larceny doesnt
Reply
#6

Load THIS plugin.

Before you run your server, re-compile your code with -d3 option. The plugin will tell you which line of code crashed the server.

If your not compiling from command line, create a file in the same directory as pawncc.exe called pawn.cfg inside this file enter: -d3

So file looks like:
Код:
-d3
Save and close the file. Recompile your code.

Crash your server and look at the server log.
Reply
#7

Then provide us the code under OnPlayerText
On the gamemodes that it crashes
Reply
#8

the server log doesnt have anything. it doesnt update.
but i have the log from crashdetect in the old script.
http://pastebin.com/ni771eJ0
Код:
public OnPlayerText(playerid, text[])
{
	// Anti Adv
    if(AntiAdv(playerid, text)) return 0;
	// The Rest
	new string[128];
	if(Mobile[playerid] != INVALID_PLAYER_ID)
	{
		format(string, sizeof(string), "(cellphone) %s says: %s", RPN(playerid), text);
		if(IsPlayerInAnyVehicle(playerid)) { //Windows closed.
			format(string, sizeof(string), "%s", string);
			SendNearbyMessage(playerid, 3.0, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		} else {
			SendNearbyMessage(playerid, 3.0, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
		}

		if(Mobile[playerid] == 914)
		{
			if(!text[0])
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: Sorry, I don't understand?");
				return 0;
			}
			SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
			SendClientMessage(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");

			format(string, sizeof(string), "Dispatch: All Units IA: Caller: %s",RPN(playerid));
			SendLSFMDMessage(COLOR_TWPINK, string);
			format(string, sizeof(string), "Dispatch: Incident: %s",text);
			SendLSFMDMessage(COLOR_TWPINK, string);

			CalledMedics[playerid] = 1;
			MedicsCallTime[playerid] = 60;
			ShowPlayerBeaconForMedics(playerid);
			SendClientMessage(playerid, COLOR_WHITE, "   They hung up...");
			Mobile[playerid] = INVALID_PLAYER_ID;

			SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
			RemovePlayerAttachedObject(playerid, 9);
			return 0;
		}
		if(Mobile[playerid] == 913)
		{
			if(!text[0])
			{
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry, I don't understand?");
				return 0;
			}
			if(strcmp("no", text, true) == 0)
			{
				SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: We have alerted all units in the area.");
				SendClientMessage(playerid, COLOR_DBLUE, "Thank you for reporting this crime.");
				format(string, sizeof(string), "HQ: All Units APB: Reporter: %s",RPN(playerid));
				SendFBIMessage(COLOR_DBLUE, string);
				SendCopMessage(COLOR_DBLUE, string);
				format(string, sizeof(string), "HQ: Crime: %s, Suspect: Unknown",PlayerCrime[playerid][pAccusing]);
				SendFBIMessage(COLOR_DBLUE, string);
				SendCopMessage(COLOR_DBLUE, string);
				CalledCops[playerid] = 1;
				CopsCallTime[playerid] = 60;
				ShowPlayerBeaconForCops(playerid);
				SendClientMessage(playerid, COLOR_WHITE, "   They hung up...");
				Mobile[playerid] = INVALID_PLAYER_ID;

				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
				RemovePlayerAttachedObject(playerid, 9);
				return 0;
			}
			new badguy = playerid;
			if(IsPlayerConnected(badguy))
			{
				if(badguy != INVALID_PLAYER_ID)
				{
					if(PlayerInfo[badguy][pCrimes] > 0)
					{
						SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: Units are already assigned to that case...");
						SendClientMessage(playerid, COLOR_DBLUE, "Thank you for reporting this crime.");
						SendClientMessage(playerid, COLOR_WHITE, "   They hung up...");
						Mobile[playerid] = INVALID_PLAYER_ID;
						return 0;
					}
					if(badguy == playerid)
					{
						SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: Don't fool around. This is an emergency line.");
						SendClientMessage(playerid, COLOR_WHITE, "   They hung up...");
						Mobile[playerid] = INVALID_PLAYER_ID;
						return 0;
					}
					SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: We have alerted all units in the area.");
					SendClientMessage(playerid, COLOR_DBLUE, "Thank you for reporting this crime.");

					format(string, sizeof(string), "HQ: All Units APB: Reporter: %s",RPN(playerid));
					SendFBIMessage(COLOR_DBLUE, string);
				    SendCopMessage(COLOR_DBLUE, string);
					format(string, sizeof(string), "HQ: Crime: %s, Suspect: %s",PlayerCrime[playerid][pAccusing], RPN(badguy));
					SendFBIMessage(COLOR_DBLUE, string);
				    SendCopMessage(COLOR_DBLUE, string);
					CalledCops[playerid] = 1;
					CopsCallTime[playerid] = 60;
					ShowPlayerBeaconForCops(playerid);
					SendClientMessage(playerid, COLOR_WHITE, "   They hung up...");
					Mobile[playerid] = INVALID_PLAYER_ID;

					SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
					RemovePlayerAttachedObject(playerid, 9);
					return 0;
				}
				return 0;
			}
			else
			{
				format(string, sizeof(string), "Police HQ: I have no information on %s, are you sure that's the correct name?",text);
				SendClientMessage(playerid, COLOR_DBLUE, string);
				return 0;
			}
		}
		if(Mobile[playerid] == 912)
		{
			if(!text[0])
			{
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry, I don't understand?");
				return 0;
			}
			strmid(PlayerCrime[playerid][pAccusing], text, 0, strlen(text), 255);
			SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: If you know the assailant's name or part of it say it now or just say no.");
			Mobile[playerid] = 913;
			return 0;
		}
		if(Mobile[playerid] == 911)
		{
			if(!text[0])
			{
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry, I don't understand - police or paramedic?");
				return 0;
			}
			else if(strcmp("police", text, true) == 0)
			{
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: I am patching you to police headquarters, please hold...");
				Mobile[playerid] = 912;
				SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: Please give me a short description of the crime.");
				return 0;
			}
			else if(strcmp("paramedic", text, true) == 0)
			{
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: I am patching you to LSFMD headquarters, please hold...");
				Mobile[playerid] = 914;
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: Please give me a short description of the incident.");
				return 0;
			}
			else
			{
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry, I don't understand - police or paramedic?");
				return 0;
			}
		}
		if(IsPlayerConnected(Mobile[playerid]))
		{
			if(Mobile[Mobile[playerid]] == playerid)
			{
				if(SpeakerPhone[playerid] != 0)
				{
				    format(string, sizeof(string), "(speakerphone) %s says: %s", RPN(playerid), text);
					SendNearbyMessage(Mobile[playerid], 3.0, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				}
				else
				{
				    SendClientMessage(Mobile[playerid], COLOR_YELLOW, string);
				}
				if(PlayerInfo[playerid][pBugged] == 1)
				{
					format(string, sizeof(string), "(bug) %s (cellphone): %s", RPN(playerid), text);
					SendAdminMessage(COLOR_LIGHTGREEN, 1, string);
				}
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "There's nobody there!");
			CellTime[playerid] = 0;
			SendClientMessage(playerid,  COLOR_WHITE, "   You hung up.");
			Mobile[playerid] = INVALID_PLAYER_ID;
			SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
			RemovePlayerAttachedObject(playerid, 9);
		}
		return 0;
	}
	else if(Live[playerid])
	{
		if(IsNewsVehicle(GetPlayerVehicleID(playerid)))
		{
			format(string, sizeof(string), "** [Live News]: %s: %s", RPN(playerid), text);
			SendClientMessageToAll(COLOR_LIGHTGREEN, string);
		}
	}
	else
	{
		if(strlen(PlayerInfo[playerid][pAccent])) format(string, sizeof(string), "(%s Accent) %s says: %s", PlayerInfo[playerid][pAccent], RPN(playerid), text);
		else format(string, sizeof(string), "%s says: %s", RPN(playerid), text);
	}
	SendNearbyMessage(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
	Log("logs/chat.log", string);
	/*format(OldSpamChat[playerid], 128, "%s", NewSpamChat[playerid]);
	format(NewSpamChat[playerid], 128, "%s", text);
	if(strlen(OldSpamChat[playerid]) > 0 && strlen(NewSpamChat[playerid]) > 0)
	{
		if(!strcmp(OldSpamChat[playerid], NewSpamChat[playerid], false))
		{
			ChatSpamCount[playerid] ++;
			if(ChatSpamCount[playerid] >= 8)
			{
				format(string, sizeof(string), "AdmCmd: %s has been f, reason: Spam", RPN(playerid));
				SendClientMessageToAll(COLOR_LIGHTRED, string);
				ChatSpamCount[playerid] = 0;
				SetTimerEx("kickbug", 5000, false, "i", playerid);
			}
		}
		else
		{
		    ChatSpamCount[playerid] = 0;
		}
	}*/
	return 0;
}
Reply
#9

I can type commands perfectly fine
Reply
#10

help!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)