Crashdetect
#1

Is there anthing wrong with this? I think that's why the server always restart.

Код:
[13:23:08] [join] Edsel has joined the server (1:190.79.200.212)
[13:24:29] [debug] Run time error 4: "Array index out of bounds"
[13:24:29] [debug]  Accessing element at negative index -1
[13:24:29] [debug] AMX backtrace:
[13:24:29] [debug] #0 0000241c in public OnPlayerDisconnect () from GroupFS.amx
[13:24:29] [part] .Vans has left the server (0:1)
[13:25:46] [debug] Run time error 4: "Array index out of bounds"
[13:25:46] [debug]  Accessing element at negative index -1
[13:25:46] [debug] AMX backtrace:
[13:25:46] [debug] #0 0000241c in public OnPlayerDisconnect () from GroupFS.amx
[13:25:46] [part] Edsel has left the server (1:1)
[14:46:46] Incoming connection: 142.255.114.132:56954
[14:46:46] [join] Gangster6840 has joined the server (0:142.255.114.132)
[14:46:46] [debug] Run time error 5: "Invalid memory access"
[14:46:46] [debug] AMX backtrace:
[14:46:46] [debug] #0 00010a58 in public flood_controlOnPlayerConnect () from LuxAdmin.amx
[14:46:46] [debug] #1 0000eff4 in public SSCANF_OnPlayerConnect () from LuxAdmin.amx
[14:46:46] [debug] #2 000061e4 in public Itter_OnPlayerConnect () from LuxAdmin.amx
[14:46:46] [debug] #3 00005728 in public OnPlayerConnect () from LuxAdmin.amx
[14:50:19] [debug] Run time error 4: "Array index out of bounds"
[14:50:19] [debug]  Accessing element at negative index -1
[14:50:19] [debug] AMX backtrace:
[14:50:19] [debug] #0 0000241c in public OnPlayerDisconnect () from GroupFS.amx
[14:50:19] [part] Gangster6840 has left the server (0:1)
Reply
#2

For public OnPlayerDisconnect () from GroupFS.amx
Код:
public OnPlayerDisconnect(playerid, reason)
{
	new file[64];
	format(file, sizeof(file), USER_PATH, GetPlayerNameEx(playerid));
	if(groupinfo[group[playerid][gid]][active])
	{
		if(!dini_Exists(file)) dini_Create(file);
		dini_IntSet(file, "GroupID", group[playerid][gid]);
	}
	else if(dini_Exists(file)) dini_Remove(file);
	return 1;
}
in public flood_controlOnPlayerConnect () from LuxAdmin.amx
Код:
public OnPlayerFloodControl(playerid, config)
{
    if(config == FLOOD_CONTROL_DEATH)
	{
        Kick(playerid);
    }
    else if(config == FLOOD_CONTROL_BOOT)
	{
        Kick(playerid);
    }
    else if(config == FLOOD_CONTROL_VEHICLES)
	{
        Kick(playerid);
    }
    return true;
}
in public flood_controlOnPlayerConnect () from LuxAdmin.amx
in public SSCANF_OnPlayerConnect () from LuxAdmin.amx
in public Itter_OnPlayerConnect () from LuxAdmin.amx
in public OnPlayerConnect () from LuxAdmin.amx
Under OnplayerConnect from Luxadmin

Код:
public OnPlayerConnect(playerid)
{
	Firedup[playerid] = 0;

	Stats[playerid] = TextDrawCreate(311.000000, 8.000000, "_");
	TextDrawBackgroundColor(Stats[playerid], 255);
	TextDrawFont(Stats[playerid], 1);
	TextDrawLetterSize(Stats[playerid], 0.290000, 0.899999);
	TextDrawColor(Stats[playerid], -1);
	TextDrawSetOutline(Stats[playerid], 0);
	TextDrawSetProportional(Stats[playerid], 1);
	TextDrawSetShadow(Stats[playerid], 1);

    
    #if EnableCamHack == true
    KeyState[playerid] = 0;
    FollowOn[playerid] = 0;
    AccInfo[playerid][InCamMod] 	= 0;
    AccInfo[playerid][LockedCam] 	= 0;
    #endif
	AccInfo[playerid][Deaths] 		= 0;
	AccInfo[playerid][Kills] 		= 0;
	AccInfo[playerid][Jailed]		= 0;
	SetPVarInt(playerid, "Jailed", 0);
	AccInfo[playerid][Frozen]		= 0;
	AccInfo[playerid][Level] 		= 0;
	AccInfo[playerid][pVip]         = 0;
	AccInfo[playerid][LoggedIn] 	= 0;
	AccInfo[playerid][Registered] 	= 0;
	AccInfo[playerid][TimesSpawned]	= 0;
	AccInfo[playerid][Muted] 		= 0;
	AccInfo[playerid][MuteWarnings]	= 0;
	AccInfo[playerid][Warnings] 	= 0;
	AccInfo[playerid][Caps]			= 0;
	AccInfo[playerid][DoorsLocked] 	= 0;
	AccInfo[playerid][pCar]			= -1;
	AccInfo[playerid][SpamCount] 	= 0;
	AccInfo[playerid][MaxAdv] 		= 0;
	AccInfo[playerid][SpamTime] 	= 0;
	AccInfo[playerid][PingCount] 	= 0;
	AccInfo[playerid][PingTime]		= 0;
	AccInfo[playerid][FailLogin] 	= 0;
	AccInfo[playerid][Hide] 		= 0;
	AccInfo[playerid][pInvis]   	= 0;
	AccInfo[playerid][OnDuty]   	= 0;
	AccInfo[playerid][pGps] 		= -1;
	
	#if EnableTwoRcon == true
	AccInfo[playerid][MaxRcon] = 0;
	#endif

	AccInfo[playerid][ConnectTime] = gettime();
    for(new i; i<PING_MAX_EXCEEDS; i++)
	AccInfo[playerid][pPing][i] = 0;
	//------------------------------------------------------
	new string[128];
    new str[128];
	new file[256];
	new PlayerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
	new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
	
	ResetForbiddenWeaponsForPlayer(playerid);
	TempBanCheck(playerid);
//==============================================================================
// Connect Messages
//==============================================================================
	if(ServerInfo[ConnectMessages] == 1)
	{
	    new pAKA[256];
		pAKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
		if (strlen(pAKA) < 3)
		format(str,sizeof(str),"{00CCFF} %s (ID:%d) {6666FF}has Joined Global Freeroam Server", PlayerName,playerid);
		else if (!strcmp(pAKA,PlayerName,true))
		format(str,sizeof(str),"{00CCFF} %s (ID:%d) {6666FF}has Joined Global Freeroam Server", PlayerName,playerid);
		else format(str,sizeof(str),"{00CCFF} %s (ID:%d) {6666FF}has Joined Global Freeroam Server (Aka: %s)",PlayerName,playerid,pAKA);

		for(new i = 0; i < MAX_PLAYERS; i++)
		if(IsPlayerConnected(i) && playerid != i)
		{
		if(AccInfo[i][Level] > 2)
		SendClientMessage(i,white,str);
		else
		{
		format(string,sizeof(string),"{00CCFF} %s (ID:%d) {6666FF}has joined the server", PlayerName, playerid);
 	    SendClientMessage(i,white,string);
		}
		}
	}
//==============================================================================
// If PlayerName is Banned
//==============================================================================
    if (dUserINT(PlayerName2(playerid)).("Banned") == 1)
    {
        SendClientMessage(playerid, red, "ATTENTION: This name is banned from this server");
		format(string,sizeof(string)," %s (ID:%d) has been Automatically  Kicked | Reason: Name Banned ",PlayerName,playerid);
		SendClientMessageToAll(grey, string);
		print(string);
		SaveIn("KickLog",string);
		SetTimerEx("KickPlayer", 500, 0, "i", playerid);
    }
//==============================================================================
// Kick Forbidden Name
//==============================================================================
	if(ServerInfo[NameKick] == 1)
	{
		for(new s = 0; s < BlockedNamesCount; s++)
		{
  			if(!strcmp(BlockedNames[s],PlayerName,true))
			{
			SendClientMessage(playerid,red, "ATTENTION: Your name is on our Black List, you have been Kicked");
			format(string,sizeof(string)," %s (ID:%d) has been Automatically Kicked | Reason: Forbidden Name",PlayerName,playerid);
			SendClientMessageToAll(grey, string);
			print(string);
			SaveIn("KickLog",string);
			SetTimerEx("KickPlayer", 500, 0, "i", playerid);
			return 1;
			}
		}
	}
//==============================================================================
// Kick Forbidden Part of Name
//==============================================================================
	if(ServerInfo[PartNameKick] == 1)
	{
		for(new s = 0; s < BlockedPartNameCount; s++)
		{
			new pos;
			while((pos = strfind(PlayerName,BlockedPartName[s],true)) != -1)
			for(new i = pos, j = pos + strlen(BlockedPartName[s]); i < j; i++)
			{
			SendClientMessage(playerid,red, "ATTENTION: Your name is not Allowed on this server, you have been Kicked!");
			format(string,sizeof(string),"%s (ID:%d) has been Automatically Kicked | Reason: Forbidden Name ",PlayerName,playerid);
			SendClientMessageToAll(grey, string);
			print(string);
			SaveIn("KickLog",string);
			SetTimerEx("KickPlayer", 500, 0, "i", playerid);
			return 1;
			}
		}
	}
//==============================================================================
// Server Locked
//==============================================================================
	if(ServerInfo[Locked] == 1)
	{
		AccInfo[playerid][AllowedIn] = false;
		SendClientMessage(playerid,red,"Server is Locked");
		SendClientMessage(playerid,red,"You have 40 seconds to enter the server Password");
		LockKickTimer[playerid] = SetTimerEx("AutoKick", 40000, 0, "i", playerid);
	}
 	if (ServerInfo[Locked] == 1 && AccInfo[playerid][AllowedIn] == false)
    {
        ShowPlayerDialog(playerid, DIALOG_TYPE_SERVPASS, DIALOG_STYLE_INPUT,
		"Server Locked!", "Enter the password to Access it:", "Access", "Exit");
	}
//==============================================================================
// Register & Login
//==============================================================================
	if(strlen(dini_Get("LuxAdmin/Config/aka.txt", tmp3)) == 0)
	dini_Set("LuxAdmin/Config/aka.txt", tmp3, PlayerName);
 	else
	{
	    if( strfind( dini_Get("LuxAdmin/Config/aka.txt", tmp3), PlayerName, true) == -1 )
		{
  		format(string,sizeof(string),"%s,%s", dini_Get("LuxAdmin/Config/aka.txt",tmp3), PlayerName);
	   	dini_Set("LuxAdmin/Config/aka.txt", tmp3, string);
		}
 	}
	if(!udb_Exists(PlayerName2(playerid)))
	SendClientMessage(playerid,orange, "Your account isn't registered. Please register (/"#RegisterCommand")");
	else
	{
 	AccInfo[playerid][Registered] = 1;
	format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName));
	new tmp2[256]; tmp2 = dini_Get(file,"Ip");

	if( (!strcmp(tmp3,tmp2,true)) && (ServerInfo[AutoLogin] == 1))
	{
		LoginPlayer(playerid);
		if(AccInfo[playerid][Level] > 0)
		{
			switch(AccInfo[playerid][Level])
			{
				case 1: AdmRank = "Trial Admin";
				case 2: AdmRank = "Advanced Admin";
				case 3: AdmRank = "Intermediate Admin";
				case 4: AdmRank = "Junior Admin";
				case 5: AdmRank = "Senior Admin";
			}
			if(AccInfo[playerid][Level] > 5)
			{
				AdmRank = "Head Admin";
			}
			//==============================================================================
			// VIP System
			//==============================================================================
			if(AccInfo[playerid][pVip] > 0)
			{
				format(string,sizeof(string),"You are now Logged in | Account: VIP | Level %d - %s", AccInfo[playerid][Level], AdmRank);
				SendClientMessage(playerid,0x00C378AA,string);
			}
			else
			{
				format(string,sizeof(string),"You are now Logged in | Level %d - %s", AccInfo[playerid][Level],AdmRank);
				SendClientMessageToAll(green, string);
			}
			//==============================================================================
			format(string,sizeof(string),"%s (%d) %s is now connected to the game", AdmRank, AccInfo[playerid][Level], PlayerName2(playerid));
			SendClientMessage(playerid, green, string);
		}
		else
		{
			if(AccInfo[playerid][pVip] > 0)
			{
				SendClientMessage(playerid,0x00C896AA,"You are now Logged in - Account Type: VIP");
				format(string,sizeof(string),"VIP %s is now connected to the game", PlayerName2(playerid));
				SendClientMessageToAll(blue, string);
			}
			else
			{
				SendClientMessage(playerid,green,"You are now Logged in");
			}
		}
  	}
 	else SendClientMessage(playerid, white, "Account is registered") &&
	SendClientMessage(playerid, orange, "Please login to access your Account (/"#LoginCommand")");
	}
 	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)