SA-MP Forums Archive
Dialog problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog problem (/showthread.php?tid=504499)



Dialog problem - MrPlaysino - 04.04.2014

Hello,

I have a problem when I run into the pickup comes nothing. And when I do a command it then stands SERVER: Unkown Command.

code:
Код:
ocmd:test(playerid,params[])
{
	    new string2[200];
		for(new i=0;i!=MAX_AUTOHAUS;i++)
		{
			if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
			{
			    for(new n=1;n<sizeof(AutoHausAuto);n++)
				{
					format(string2,sizeof string2,"\n%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
				}
				ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_STYLE_LIST,"Autohaus",string2,"Weiter","");
			}
			continue;
		}
		return 1;
}



Re : Dialog problem - S4t3K - 04.04.2014

Your indentation is fuckin bad.

A DIALOG_STYLE_LIST string must finish with a "\n".

So your format will become

PHP код:

format
(string2sizeof(string2), "\n%s\n"CarName[AutoHausAuto[n][aAutoID] - 400]); 
Also why does the "continue;" symbol does here ?

And for the error of the "server : unknown command", returning 0 to a dialog ID or a command name will show the message.


Re: Dialog problem - Konstantinos - 04.04.2014

Possible run time error 4. For example, if the ID of the vehicle is 0, it will access element at negative index -400.

Just to be sure though, use crashdetect plugin: https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
Use debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

Re-compile your scripts and start the server. Execute the command and if it displays the unknown command message again, then post your server log.


AW: Dialog problem - MrPlaysino - 04.04.2014

Sorry I use the ****** translator.

It has brought nothing. It opens no dialogue. And the crashdetectet with the there was no file.

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           6536 bytes
Code size:           230724 bytes
Data size:          1521964 bytes
Stack/heap size:      16384 bytes; estimated max. usage=2275 cells (9100 bytes)
Total requirements: 1775608 bytes



Re: Dialog problem - Konstantinos - 04.04.2014

It doesn't print anything to the server log (with [debug] prefix) even if it displays the unknown command in-game?


AW: Dialog problem - MrPlaysino - 04.04.2014

No, there is simply nothing.... Please help me..


Re: Dialog problem - Konstantinos - 04.04.2014

Are you sure you loaded the crashdetect plugin or that it was loaded without problems? Because without its information is difficult to find the problem unless you manually debug it (print messages in each line of the command and see which one was the last line was executed).


Re: Dialog problem - Dokins - 04.04.2014

You don't need the continue; there.

Try this man! (untested)

pawn Код:
ocmd:test(playerid,params[])
{
        new string2[200];
        for(new i=0;i!=MAX_AUTOHAUS;i++)
        {
            if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
            {
                for(new n=1;n<sizeof(AutoHausAuto);n++)
                {
                    if(i == 1)
                    {
                        format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
                    }
                    else
                    {
                        format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[n][aAutoID] - 400]);
                    }
                }
                ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_STYLE_LIST,"Autohaus",string2,"Weiter","");
            }
        }
        return 1;
}



AW: Dialog problem - MrPlaysino - 04.04.2014



I can not use Crashdetected. And the above-mentioned file is not available for Windows XP?


@Dokins This does not work well


Re : Dialog problem - S4t3K - 04.04.2014

You need the c++ visual library package (latest version is prefered).

If I translate correctly, it would mean a missing dll message (here, msvcp120.dll).
Either, please translate in English. I took Spanish in 2nd language, not German.