[Debug] onplayerconnect
#1

I got that then server crashed:
NEW CODE DEBUG *:-
Код:
[09:24:42]+ [debug] Run time error 5: "Invalid memory access"
[09:24:42]+ [debug] AMX backtrace:
[09:24:42]+ [debug] #0 00001db8 in dini_Set (filename[]=@0x0007941c "LuxAdmin/Config/aka.txt", key[]=@0xfffff6d8 "", value[]=@0xfffff7a0 "") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\dini.inc:67


Код:
[14:34:08]+ [death] Karolis_Sankaba died 255
[14:34:08]+ [join] Edward_Calen has joined the server (2:176.186.148.156)
[14:34:08]+ [debug] Run time error 5: "Invalid memory access"
[14:34:08]+ [debug] AMX backtrace:
[14:34:08]+ [debug] #0 00006da0 in public OnPlayerConnect () from AdminSystem.amx
Here is admin system OnPlayerConnect:
Код:
//==============================================================================
//-------------------------------------------------
// 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;
}
Reply
#2

Perhaps your machine does not have the proper memory to support the occurrences?
pawn Код:
[14:34:08]+ [debug] Run time error 5: "Invalid memory access"
Reply
#3

I dont know i solved many problems but onplayerconnect cant be solved :/
Reply
#4

Help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)