CRASH :@
#1

My server keep crashing and i can't use another admin system because my Gm based on Lux this is Lux Admin edited by me

If you want really help this is the link:
Admin System.pwn
CODE:
Код:
//==============================================================================
//-------------------------------------------------
// Player Connected
//-------------------------------------------------
//==============================================================================
public OnPlayerConnect(playerid)
{
	AccInfo[playerid][Deaths] 		= 0;
	AccInfo[playerid][Kills] 		= 0;
	AccInfo[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][God] 			= 0;
	AccInfo[playerid][GodCar]		= 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][pGps] 		= -1;
	AccInfo[playerid][Duty]			= 0;





	#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);
	
 	new AKA[256];
	AKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
	
/*	for(new i = 0; i <= strlen(AKA); i++)
	{
		if(AKA[i] == ',')
		{
  			commacount[playerid]++;
			if(commacount[playerid] > 1)
			{
			    format(string,sizeof(string),"[AKA KICK]:- %s Has Been Kicked For Exceeding AKA Limit",PlayerName2(playerid));
			    printf("%s",string);
			    SendClientMessageToAll(red,string);
			    Kick(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),"{FFFFFF}%s [ID:%d] {6EF83C}has joined the server", PlayerName,playerid);
		else if (!strcmp(pAKA,PlayerName,true))
		format(str,sizeof(str),"{FFFFFF}%s [ID:%d] {6EF83C}has joined the server", PlayerName,playerid);
		else format(str,sizeof(str),"{FFFFFF}%s [ID:%d] {6EF83C}has joined the server | {F00000}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,green,str);
		else
		{
		format(string,sizeof(string),"{FFFFFF}%s [ID:%d] {6EF83C}has joined the server", PlayerName, playerid);
 	    SendClientMessage(i,green,string);
		}
		}
 }
//==============================================================================
// If PlayerName is Banned
//==============================================================================
    if (dUserINT(PlayerName2(playerid)).("Banned") == 1)
    {
        new BanStringFormat[256];
        new BannedStr[3000];
		strcat(BannedStr,"{FFFFFF}________________________________________SPA-Banned!________________________________________");
		strcat(BannedStr,"\n\n{6EF83C}Your Account is Banned from this server.\n{F81414}To unban your account please visit our Forum: samp-server.eu5.org\n{00C0FF}Greets, SPA Team");
		strcat(BannedStr,"\n\n{FF0000}You Are Banned From This Server");
		format(BanStringFormat,sizeof(BanStringFormat),"\n{FFD700}Name: {FFFFFF}%s",PlayerName2(playerid));
		strcat(BannedStr,BanStringFormat);
		format(BanStringFormat,sizeof(BanStringFormat),"\n{FFD700}BannedBy: {FFFFFF}%s",dini_Get(BanIdFile(dUserINT(PlayerName2(playerid)).("RandomBanNumber")),"BannedBy"));
		strcat(BannedStr,BanStringFormat);
		format(BanStringFormat,sizeof(BanStringFormat),"\n{FFD700}Reason Of Ban: {FFFFFF}%s",dini_Get(BanIdFile(dUserINT(PlayerName2(playerid)).("RandomBanNumber")),"ReasonOfBan"));
		strcat(BannedStr,BanStringFormat);
		format(BanStringFormat,sizeof(BanStringFormat),"\n{FFD700}Ban Id: {FFFFFF}%d",dUserINT(PlayerName2(playerid)).("RandomBanNumber"));
		strcat(BannedStr,BanStringFormat);
		strcat(BannedStr,"\n\n{FFFFFF}___________________________________________________________________________________________\n\n");
		strcat(BannedStr,"{FF0000}If You think you are wrongly banned , please report that admin who banned you and the reason of ban.");
		strcat(BannedStr,"\nIf you are found guilty the owner / admin can  ban you permanently, Please Visit");
		strcat(BannedStr,"\n{FFD700}samp-server.eu5.org. {FF0000}For More Information. If you want to get your account unbanned,");
		strcat(BannedStr,"\nYou need to post for an unban appeal!");
		ShowPlayerDialog(playerid,BannedDialog,DIALOG_STYLE_MSGBOX,"Banned",BannedStr,"OK","");
        SendClientMessage(playerid, red, "ATTENTION: This name is banned from this server!");
		format(string,sizeof(string),"%s (Id:%d) has beenAutomatically  Kicked.{FFFFFF} [Reason]: Name Banned! ",PlayerName,playerid);
		SendClientMessageToAll(red, string);  print(string);
		SaveIn("KickLog",string);
		SetTimerEx("DelayKick",500,0,"d",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)," Player %s (Id:%d) has been Automatically Kicked.[Reason]: Forbidden Name ",PlayerName,playerid);
			SendClientMessageToAll(red, string);
			print(string);
			SaveIn("KickLog",string);
			Kick(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)," Player %s (Id:%d) has been Automatically Kicked. | Reason: Forbidden Name ",PlayerName,playerid);
			SendClientMessageToAll(red, string);  print(string);
			SaveIn("KickLog",string);  Kick(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, "SERVER: 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 = "{FF0000}Tester{FF0000}";
				case 2: AdmRank = "{FF0000}Moderator{FF0000}";
				case 3: AdmRank = "{FF0000}Admin{FF0000}";
				case 4: AdmRank = "{375FFF}Leader{FF0000}";
				case 5: AdmRank = "{375FFF}Manager{FF0000}";
				}
			if(AccInfo[playerid][Level] > 10)
			{
				AdmRank = "{00FF00}Manager{FF0000}";
			}
//==============================================================================
// VIP System
//==============================================================================
			if(AccInfo[playerid][pVip] > 3)
			{
				switch(AccInfo[playerid][pVip])
    				{
					case 1: AccType = "Free";
					case 2: AccType = "Silver";
					case 3: AccType = "Gold";
					case 4: AccType = "Premium";
					}
				format(string,sizeof(string),"You have been Automatically Logged in.{FF0000}(VIP: %s) (%s)", AccType,AdmRank);
				SendClientMessage(playerid,green,string);
			}
			else
			{
				format(string,sizeof(string),"You have been Automatically Logged in. {FF0000} (%s)",AdmRank);
				SendClientMessage(playerid,green,string);
			}
//==============================================================================
		}
		else
		{
			if(AccInfo[playerid][pVip] > 3)
			{
				switch(AccInfo[playerid][pVip])
    				{
					case 1: AccType = "Free";
					case 2: AccType = "Silver";
					case 3: AccType = "Gold";
					case 4: AccType = "Premium";
					}
				format(string,sizeof(string),"You have been Automatically Logged in {FF0000}(VIP: %s)", AccType);
				SendClientMessage(playerid,green,string);
			}
			else
			{
				format(string,sizeof(string),"You have been Automatically {FF0000}Logged in");
				SendClientMessage(playerid,green,string);
			}
		}
  	}
  	}
	if(ServerInfo[MustLogin] == 1 && AccInfo[playerid][Registered] == 1 && AccInfo[playerid][LoggedIn] == 0 && dUserINT(PlayerName2(playerid)).("Banned") == 0)
	{
		#if USE_DIALOGS == true
		new lstring[400];
		format(lstring,400,"{FFFFFF}Welcome back to {6EF83C}xXx Stunt Paradise Awesome™, {FFFFFF}This Account {FF0000}' %s ' {FFFFFF}is Already Registered! login to access your account:",pName(playerid));
		ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE_PASSWORD,"Login Account",lstring,"Login","Quit");
		#endif
		return 1;
	}
	if(AccInfo[playerid][Registered] == 0 && ServerInfo[MustRegister] == 1)
	{
		#if USE_DIALOGS == true
		new rstring[380];
		format(rstring,380,"Welcome '%s',You'r Account is not registred!\n Why Do i have to register??:-\n{6EF83C}- To Save Your Stats in server Like money and score!\n - To be sure that no one will use your account!\n{00FFFF}Enter the password to Register your Account, Don't type you'r name as password!:",pName(playerid));
		ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE_PASSWORD,"Register Account",rstring,"Register","Guest");
		#endif
		return 1;
	}
 	return 1;
}

forward DelayKick(playerid);
public DelayKick(playerid)
{

     	return Kick(playerid);
}



Before the server crashing every 12 Hours i got random warn not always , like that:

Код:
[13:47:51]+ [join] kauan has joined the server (22:186.237.179.219)
[13:47:51]+ [debug] Run time error 5: "Invalid memory access"
[13:47:51]+ [debug] AMX backtrace:
[13:47:51]+ [debug] #0 00008740 in public OnPlayerConnect () at C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\AdminSystem.pwn:517

Код:
[13:41:03]+ [debug] Server crashed while executing AdminSystem.amx
[13:41:03]+ [debug] AMX backtrace:
[13:41:03]+ [debug] #0 native fwrite () [0809aad0] from samp03svr
[13:41:03]+ [debug] #1 00001fdc in dini_Set (filename[]=@0x00075950 "LuxAdmin/Config/aka.txt", key[]=@0x001554dc "93.142.135.52", value[]=@0x001555a4 "Dark") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\dini.inc:82
[13:41:03]+ [debug] #2 00009e88 in public OnPlayerConnect (playerid=4) at C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\AdminSystem.pwn:647
[13:41:03]+ [debug] Native backtrace:
[13:41:03]+ [debug] #0 b7332246 in _ZN10StackTraceC2EPv () from plugins/crashdetect.so
[13:41:03]+ [debug] #1 b732af03 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[13:41:03]+ [debug] #2 b732b97c in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[13:41:03]+ [debug] #3 b732ddf4 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[13:41:03]+ [debug] #4 b7331d1d in ?? () from plugins/crashdetect.so
[13:41:03]+ [debug] #5 b777a600 in ?? ()
[13:41:03]+ [debug] #6 b777a420 in ?? ()
[13:41:03]+ [debug] #7 b749e1df in gsignal () from /lib/i386-linux-gnu/libc.so.6
[13:41:03]+ [debug] #8 b74a1825 in abort () from /lib/i386-linux-gnu/libc.so.6
[13:41:03]+ [debug] #9 b7497085 in ?? () from /lib/i386-linux-gnu/libc.so.6
[13:41:03]+ [debug] #10 b7497137 in ?? () from /lib/i386-linux-gnu/libc.so.6
[13:41:03]+ [debug] #11 0809a6fc in ?? () from ./samp03svr
[13:41:03]+ [debug] #12 0809ab5f in ?? () from ./samp03svr
[13:41:03]+ [debug] #13 08093e44 in ?? () from ./samp03svr
[13:41:03]+ [debug] #14 b732aa91 in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
Reply
#2

no code no support
Reply
#3

Quote:
Originally Posted by kirollos
Посмотреть сообщение
no code no support
Here is the full CODE of my admin system , thanks
Reply
#4

help?
Reply
#5

According to the code, It might not be able get enough memory from Linux.
I'm not sure though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)