server crashes.
#1

Here's the code:


the first time to call Dialog is under the one sec timer

//
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(i, "PassedCode"),GetPVarInt(i, "FailedCode"));
they didnt look right in-game.
//


Код:
				if(GetPVarInt(i, "RamHouse") > 0)
				{
				    if(IsPlayerInRangeOfPoint(i,2.0, HouseInfo[GetPVarInt(i, "RamHouseID")][hXo], HouseInfo[GetPVarInt(i, "RamHouseID")][hYo], HouseInfo[GetPVarInt(i, "RamHouseID")][hZo]))
				    {
				        SetPVarInt(i, "RamHouse", GetPVarInt(i, "RamHouse")+1);
				        /*format(string, sizeof(string),"~w~%d", GetPVarInt(i, "RamHouse"));
				        GameTextForPlayer(i, string, 1000, 6);*/
				        if(GetPVarInt(i, "RamHouse") == 21)
				        {
				    		ApplyAnimation(i, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
						    SetPVarInt(i,"Uncoding", 1);
						    SetPVarInt(i,"UnCodeRound", 1);
						    ProgressBar(i, "UNCODING...", 25, 4);
						    HouseHasCCTV(i);
			format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[i][pUncode]);
			format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(i, "PassedCode"),GetPVarInt(i, "FailedCode"));
							ShowPlayerDialog(i,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"GO","END");
                			//HouseInfo[GetPVarInt(i, "RamHouseID")][hLocked]=0;
    				        //DeletePVar(i,"RamHouse");
						    //DeletePVar(i,"RamHouseID");
						    //StopProgress(i);
				        }
				    }
				    else
				    {
				        DeletePVar(i,"RamHouse");
						DeletePVar(i,"RamHouseID");
						SendClientMessage(i,COLOR_LIGHTRED, "TOO FAR.");
						StopProgress(i);
				    }
				}
Код:
	
if(dialogid == DIALOG_UNCODE)
	{
	    new Float: x, Float: y, Float:z;
		new getPOS = GetPlayerPos(playerid, x, y, z);
		
		if(!response)
		{
			DeletePVar(playerid, "RamHouseID");
			DeletePVar(playerid, "RamHouse");
			DeletePVar(playerid, "UnCodeRound");
   			StopProgress(playerid);
			DeletePVar(playerid,"PassedCode");
			DeletePVar(playerid,"FailedCode");
   			DeletePVar(playerid,"Uncoding");
			return 1;
		}
		SetPVarInt(playerid,"UnCodeRound", GetPVarInt(playerid,"UnCodeRound")+1);
		if(strlen(inputtext) > 0 && strlen(inputtext) < 31 && strcmp(inputtext, PlayerInfo[playerid][pUncode]) == 0)
		{
		    if(GetPVarInt(playerid,"UnCodeRound") == 5)
		    {
		        if(GetPVarInt(playerid,"FailedCode") > GetPVarInt(playerid,"PassedCode"))
		        {
					DeletePVar(playerid, "RamHouseID");
					DeletePVar(playerid, "RamHouse");
					DeletePVar(playerid, "UnCodeRound");
		   			StopProgress(playerid);
					DeletePVar(playerid,"PassedCode");
					DeletePVar(playerid,"FailedCode");
		   			DeletePVar(playerid,"Uncoding");
		   			SetPVarInt(playerid, "PL_NotAllowed", 1);
                    scm(playerid, COLOR_GREY, "FAILED!");
                    CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, getPOS, GetPlayerArea(playerid));
		        }
		        else
		        {
		            GameTextForPlayer(playerid, "~w~HOUSE~g~UNLOCKED!", 5000, 0);
		            HouseInfo[GetPVarInt(playerid, "RamHouseID")][hLocked]=0;
		            //reset
   					DeletePVar(playerid, "RamHouseID");
					DeletePVar(playerid, "RamHouse");
					DeletePVar(playerid, "UnCodeRound");
		   			StopProgress(playerid);
					DeletePVar(playerid,"PassedCode");
					DeletePVar(playerid,"FailedCode");
		   			DeletePVar(playerid,"Uncoding");
		   			SetPVarInt(playerid, "PL_NotAllowed", 1);
		   			ProgressBar(playerid, "UNCODING...", 25, 4);
		        }
		    }
		    PicklockString(playerid);
			format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
			format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid, "PassedCode"),GetPVarInt(playerid, "FailedCode"));
			ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
			SetPVarInt(playerid,"PassedCode", 0);
			SetPVarInt(playerid,"FailedCode", GetPVarInt(playerid,"FailedCode")+1);
			DisablePlayerCheckpoint(playerid);
			SetPVarInt(playerid,"Uncoding", 1);
			SetPVarInt(playerid, "DoubleLose", 0);
			
		    return 1;
		}
		//Go next
		if(GetPVarInt(playerid,"DoubleLose") == 2)
		{
			DeletePVar(playerid, "RamHouseID");
			DeletePVar(playerid, "RamHouse");
			DeletePVar(playerid, "UnCodeRound");
			StopProgress(playerid);
			DeletePVar(playerid,"PassedCode");
			DeletePVar(playerid,"FailedCode");
			DeletePVar(playerid,"Uncoding");
			SetPVarInt(playerid, "PL_NotAllowed", 1);
   			scm(playerid, COLOR_GREY, "You got two losing streaks, you will be reported by CCTV!");
   			CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, getPOS, GetPlayerArea(playerid));
   			return 1;
		}
		PicklockString(playerid);
		ProgressBar(playerid, "UNCODING...", 25, 4);
			format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
			format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid, "PassedCode"),GetPVarInt(playerid, "FailedCode"));
		ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
		SetPVarInt(playerid,"PassedCode", 0);
		SetPVarInt(playerid,"FailedCode", GetPVarInt(playerid,"FailedCode")+1);
		DisablePlayerCheckpoint(playerid);
		SetPVarInt(playerid,"Uncoding", 1);
		SetPVarInt(playerid, "DoubleLose", GetPVarInt(playerid,"DoubleLose")+1);
		return 1;
	}
Код:
function SendHouseCrimeReport(hid, x, y, z, area[])
{
    new string[128];
	if(x > 46.7115 && y > -2755.979 && x < 2931.147 && y < -548.8602)
	{
		SendFactionMessage(1, COLOR_BLUE, "HQ: All units - HQ: House	 Burglary.");
		format(string, sizeof(string), "Located at: %s", area);
		SendFactionMessage(1, COLOR_BLUE, string);
		printf("SendHouseCrimeReport Called! %d %f %f %f %s", hid, x, y, z, area);
	}
	return 1;
}
Reply
#2

upupup
Reply
#3

Hello!

When the server crashes then you can use the plugin "crashdetect" to get more information.
https://sampforum.blast.hk/showthread.php?tid=262796
Reply
#4

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

When the server crashes then you can use the plugin "crashdetect" to get more information.
https://sampforum.blast.hk/showthread.php?tid=262796
I have, the details below.

Код:
[12:31:38] [debug] Server crashed while executing <unknown>
[12:31:38] [debug] AMX backtrace:
[12:31:38] [debug] #0 native CallRemoteFunction () from samp-server.exe
[12:31:38] [debug] #1 0008a508 in public GPD_OnDialogResponse (7, 6729, 1, -1, 673727300) from <unknown>
[12:31:38] [debug] #2 native CallLocalFunction () from samp-server.exe
[12:31:38] [debug] #3 000128c0 in public OnDialogResponse (7, 6729, 1, -1, 673727176) from <unknown>
[12:31:38] [debug] Native backtrace:
[12:31:38] [debug] #0 0047431f in ?? () from samp-server.exe
[12:31:38] [debug] #1 004010b6 in ?? () from samp-server.exe
[12:31:38] [debug] #2 501062ca in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #3 50108b28 in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #4 501009c7 in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #5 5010631a in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #6 500451b9 in ?? () from plugins\streamer.DLL
[12:31:38] [debug] #7 004746be in ?? () from samp-server.exe
[12:31:38] [debug] #8 004010b6 in ?? () from samp-server.exe
[12:31:38] [debug] #9 501062ca in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #10 50108b28 in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #11 501009c7 in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #12 5010631a in ?? () from plugins\crashdetect.DLL
[12:31:38] [debug] #13 500451b9 in ?? () from plugins\streamer.DLL
[12:31:38] [debug] #14 0046ec31 in ?? () from samp-server.exe
[12:31:38] [debug] #15 00452270 in ?? () from samp-server.exe
[12:31:38] [debug] #16 0049eef9 in ?? () from samp-server.exe
[12:31:38] [debug] #17 004aa31e in ?? () from samp-server.exe
Reply
#5

Код:
function SendHouseCrimeReport(hid, Float:x, Float:y, Float:z, area[])
{
    new string[128];
	if(x > 46.7115 && y > -2755.979 && x < 2931.147 && y < -548.8602)
	{
		SendFactionMessage(1, COLOR_BLUE, "HQ: All units - HQ: House	 Burglary.");
		format(string, sizeof(string), "Located at: %s", area);
		SendFactionMessage(1, COLOR_BLUE, string);
		printf("SendHouseCrimeReport Called! %d %f %f %f %s", hid, x, y, z, area);
	}
	return 1;
}
Float tag was missing in x y z parameters in your function
Reply
#6

pawn Код:
CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, getPOS, GetPlayerArea(playerid));
if GetPlayerArea returns null (empty) and you pass an empty string in CallRemoteFunction, it will crash the server.

pawn Код:
#if !defined isnull
    #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
pawn Код:
#if !defined strcpy
    #define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
pawn Код:
new name_of_area[32]; // change to a size that fits your purposes
strcpy(name_of_area, GetPlayerArea(playerid));

CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, x, y, z, isnull(name_of_area) ? ("\1") : name_of_area);
EDIT: It might also be the number of arguments does not much the number of format as the rest of users mentioned. "getPOS" will only be 1 because the function returned success.
Reply
#7

PHP код:
if(dialogid == DIALOG_UNCODE)
{
        new 
FloatxFloatyFloat:z;
        new 
getPOS GetPlayerPos(playeridxyz);
        if(!
response)
        {
            
DeletePVar(playerid"RamHouseID");
            
DeletePVar(playerid"RamHouse");
            
DeletePVar(playerid"UnCodeRound");
               
StopProgress(playerid);
            
DeletePVar(playerid,"PassedCode");
            
DeletePVar(playerid,"FailedCode");
               
DeletePVar(playerid,"Uncoding");
            return 
1;
        }
        
SetPVarInt(playerid,"UnCodeRound"GetPVarInt(playerid,"UnCodeRound")+1);
        if(
strlen(inputtext) > && strlen(inputtext) < 31 && strcmp(inputtextPlayerInfo[playerid][pUncode]) == 0)
        {
            if(
GetPVarInt(playerid,"UnCodeRound") == 5)
            {
                if(
GetPVarInt(playerid,"FailedCode") > GetPVarInt(playerid,"PassedCode"))
                {
                    
DeletePVar(playerid"RamHouseID");
                    
DeletePVar(playerid"RamHouse");
                    
DeletePVar(playerid"UnCodeRound");
                       
StopProgress(playerid);
                    
DeletePVar(playerid,"PassedCode");
                    
DeletePVar(playerid,"FailedCode");
                       
DeletePVar(playerid,"Uncoding");
                       
SetPVarInt(playerid"PL_NotAllowed"1);
                    
scm(playeridCOLOR_GREY"FAILED!");
                    
CallRemoteFunction("SendHouseCrimeReport","ifffs"playeridx,y,zGetPlayerArea(playerid));
                }
                else
                {
                    
GameTextForPlayer(playerid"~w~HOUSE~g~UNLOCKED!"50000);
                    
HouseInfo[GetPVarInt(playerid"RamHouseID")][hLocked]=0;
                    
//reset
                       
DeletePVar(playerid"RamHouseID");
                    
DeletePVar(playerid"RamHouse");
                    
DeletePVar(playerid"UnCodeRound");
                       
StopProgress(playerid);
                    
DeletePVar(playerid,"PassedCode");
                    
DeletePVar(playerid,"FailedCode");
                       
DeletePVar(playerid,"Uncoding");
                       
SetPVarInt(playerid"PL_NotAllowed"1);
                       
ProgressBar(playerid"UNCODING..."254);
                }
            }
            
PicklockString(playerid);
            
format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
            
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid"PassedCode"),GetPVarInt(playerid"FailedCode"));
            
ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
            
SetPVarInt(playerid,"PassedCode"0);
            
SetPVarInt(playerid,"FailedCode"GetPVarInt(playerid,"FailedCode")+1);
            
DisablePlayerCheckpoint(playerid);
            
SetPVarInt(playerid,"Uncoding"1);
            
SetPVarInt(playerid"DoubleLose"0);
            return 
1;
        }
        
//Go next
        
if(GetPVarInt(playerid,"DoubleLose") == 2)
        {
            
DeletePVar(playerid"RamHouseID");
            
DeletePVar(playerid"RamHouse");
            
DeletePVar(playerid"UnCodeRound");
            
StopProgress(playerid);
            
DeletePVar(playerid,"PassedCode");
            
DeletePVar(playerid,"FailedCode");
            
DeletePVar(playerid,"Uncoding");
            
SetPVarInt(playerid"PL_NotAllowed"1);
               
scm(playeridCOLOR_GREY"You got two losing streaks, you will be reported by CCTV!");
               
CallRemoteFunction("SendHouseCrimeReport","ifffs"playeridx,y,zGetPlayerArea(playerid));
               return 
1;
        }
        
PicklockString(playerid);
        
ProgressBar(playerid"UNCODING..."254);
        
format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
        
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid"PassedCode"),GetPVarInt(playerid"FailedCode"));
        
ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
        
SetPVarInt(playerid,"PassedCode"0);
        
SetPVarInt(playerid,"FailedCode"GetPVarInt(playerid,"FailedCode")+1);
        
DisablePlayerCheckpoint(playerid);
        
SetPVarInt(playerid,"Uncoding"1);
        
SetPVarInt(playerid"DoubleLose"GetPVarInt(playerid,"DoubleLose")+1);
        return 
1;
    } 
So, it should work.

PHP код:
CallRemoteFunction("SendHouseCrimeReport","ifffs"playeridx,y,zGetPlayerArea(playerid)); 
You have to use x,y,z instead of getPOS.
Reply
#8

Quote:
Originally Posted by Mencent
Посмотреть сообщение
PHP код:
if(dialogid == DIALOG_UNCODE)
{
        new 
FloatxFloatyFloat:z;
        new 
getPOS GetPlayerPos(playeridxyz);
        if(!
response)
        {
            
DeletePVar(playerid"RamHouseID");
            
DeletePVar(playerid"RamHouse");
            
DeletePVar(playerid"UnCodeRound");
               
StopProgress(playerid);
            
DeletePVar(playerid,"PassedCode");
            
DeletePVar(playerid,"FailedCode");
               
DeletePVar(playerid,"Uncoding");
            return 
1;
        }
        
SetPVarInt(playerid,"UnCodeRound"GetPVarInt(playerid,"UnCodeRound")+1);
        if(
strlen(inputtext) > && strlen(inputtext) < 31 && strcmp(inputtextPlayerInfo[playerid][pUncode]) == 0)
        {
            if(
GetPVarInt(playerid,"UnCodeRound") == 5)
            {
                if(
GetPVarInt(playerid,"FailedCode") > GetPVarInt(playerid,"PassedCode"))
                {
                    
DeletePVar(playerid"RamHouseID");
                    
DeletePVar(playerid"RamHouse");
                    
DeletePVar(playerid"UnCodeRound");
                       
StopProgress(playerid);
                    
DeletePVar(playerid,"PassedCode");
                    
DeletePVar(playerid,"FailedCode");
                       
DeletePVar(playerid,"Uncoding");
                       
SetPVarInt(playerid"PL_NotAllowed"1);
                    
scm(playeridCOLOR_GREY"FAILED!");
                    
CallRemoteFunction("SendHouseCrimeReport","ifffs"playeridx,y,zGetPlayerArea(playerid));
                }
                else
                {
                    
GameTextForPlayer(playerid"~w~HOUSE~g~UNLOCKED!"50000);
                    
HouseInfo[GetPVarInt(playerid"RamHouseID")][hLocked]=0;
                    
//reset
                       
DeletePVar(playerid"RamHouseID");
                    
DeletePVar(playerid"RamHouse");
                    
DeletePVar(playerid"UnCodeRound");
                       
StopProgress(playerid);
                    
DeletePVar(playerid,"PassedCode");
                    
DeletePVar(playerid,"FailedCode");
                       
DeletePVar(playerid,"Uncoding");
                       
SetPVarInt(playerid"PL_NotAllowed"1);
                       
ProgressBar(playerid"UNCODING..."254);
                }
            }
            
PicklockString(playerid);
            
format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
            
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid"PassedCode"),GetPVarInt(playerid"FailedCode"));
            
ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
            
SetPVarInt(playerid,"PassedCode"0);
            
SetPVarInt(playerid,"FailedCode"GetPVarInt(playerid,"FailedCode")+1);
            
DisablePlayerCheckpoint(playerid);
            
SetPVarInt(playerid,"Uncoding"1);
            
SetPVarInt(playerid"DoubleLose"0);
            return 
1;
        }
        
//Go next
        
if(GetPVarInt(playerid,"DoubleLose") == 2)
        {
            
DeletePVar(playerid"RamHouseID");
            
DeletePVar(playerid"RamHouse");
            
DeletePVar(playerid"UnCodeRound");
            
StopProgress(playerid);
            
DeletePVar(playerid,"PassedCode");
            
DeletePVar(playerid,"FailedCode");
            
DeletePVar(playerid,"Uncoding");
            
SetPVarInt(playerid"PL_NotAllowed"1);
               
scm(playeridCOLOR_GREY"You got two losing streaks, you will be reported by CCTV!");
               
CallRemoteFunction("SendHouseCrimeReport","ifffs"playeridx,y,zGetPlayerArea(playerid));
               return 
1;
        }
        
PicklockString(playerid);
        
ProgressBar(playerid"UNCODING..."254);
        
format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
        
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid"PassedCode"),GetPVarInt(playerid"FailedCode"));
        
ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
        
SetPVarInt(playerid,"PassedCode"0);
        
SetPVarInt(playerid,"FailedCode"GetPVarInt(playerid,"FailedCode")+1);
        
DisablePlayerCheckpoint(playerid);
        
SetPVarInt(playerid,"Uncoding"1);
        
SetPVarInt(playerid"DoubleLose"GetPVarInt(playerid,"DoubleLose")+1);
        return 
1;
    } 
So, it should work.

PHP код:
CallRemoteFunction("SendHouseCrimeReport","ifffs"playeridx,y,zGetPlayerArea(playerid)); 
You have to use x,y,z instead of getPOS.
I think getPos is same as x,y,z because getplayerpos only takes out the float, idk let me try thanks.
Reply
#9

You still did not add Float: tags to your function as I told you in my previous reply which is causing it to fail.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)