PDA

View Full Version : Dialog problem


MrPlaysino
04/04/2014, 06:06 PM
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_S TYLE_LIST,"Autohaus",string2,"Weiter","");
}
continue;
}
return 1;
}

S4t3K
04/04/2014, 06:09 PM
Your indentation is fuckin bad.

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

So your format will become



format(string2, sizeof(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.

Konstantinos
04/04/2014, 06:10 PM
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-crashdetect/releases/tag/v4.13.1
Use debug info: https://github.com/Zeex/samp-plugin-crashdetect/wiki/Compiling-scripts-with-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.

MrPlaysino
04/04/2014, 06:19 PM
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 (c) 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

Konstantinos
04/04/2014, 06:21 PM
It doesn't print anything to the server log (with [debug] prefix) even if it displays the unknown command in-game?

MrPlaysino
04/04/2014, 06:22 PM
No, there is simply nothing.... Please help me..

Konstantinos
04/04/2014, 06:29 PM
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).

Dokins
04/04/2014, 06:34 PM
You don't need the continue; there.

Try this man! (untested)


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_S TYLE_LIST,"Autohaus",string2,"Weiter","");
}
}
return 1;
}

MrPlaysino
04/04/2014, 06:41 PM
http://s7.directupload.net/images/140404/s5w6bkc2.jpg

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


@Dokins This does not work well

S4t3K
04/04/2014, 06:44 PM
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.

Dokins
04/04/2014, 06:46 PM
I've edited, your variables are a little confusing! I apologise.

MrPlaysino
04/04/2014, 06:46 PM
Yes, msvcp120.dl is missing, but its not for windows xp...

Konstantinos
04/04/2014, 06:51 PM
http://forum.sa-mp.com/showpost.php?p=2849950&postcount=364

MrPlaysino
04/04/2014, 06:59 PM
The application or DLL .. msvcp120.dll is not a valid Windows file. Check this with the installation disk

I have the VC + +2013, VC + +12.0 installed. Nevertheless, it does not work

Konstantinos
04/04/2014, 07:08 PM
I use Windows XP too and I got no problems with crashdetect. Which one did you try to install? Try the last one: vcredist_x86.exe

MrPlaysino
04/04/2014, 07:09 PM
I now have geprintet it a try.
SERVER-LOG:
1
2
3
4
5

Code
ocmd:test(playerid,params[])
{
print("1");
new string2[200];
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
print("2");
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
print("3");
for(new n=1;n<sizeof(AutoHausAuto);n++)
{
print("4");
if(n == 1)
{
print("5");
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
print("6");
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[n][aAutoID] - 400]);
}
print("7");
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");
print("8");
}
}
return 1;
}

Konstantinos
04/04/2014, 07:13 PM
Okay, so the problem is the one I mentioned in my first post.


CarName[AutoHausAuto[n][aAutoID] - 400]

If AutoHausAuto[n][aAutoID] is 0, then it's:

CarName[-400]

which is out of bounds. You need to check whether the modelid is valid before doing it. Assuming you already know it but just in case - aAutoID must store the modelid. In case it does store the vehicleid, you need to use GetVehicleModel function.

S4t3K
04/04/2014, 07:36 PM
When you create the var for the car, just make it starting at 400.
Or make a huge array.

MrPlaysino
04/04/2014, 07:47 PM
Ok, now displays a dialog. But if I make 2 vehicles, it displays only the 1 and not the 2

new string2[200];
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
break;
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Konstantinos
04/04/2014, 07:51 PM
You used break; so it stops the loop and it has been executed only once.

MrPlaysino
04/04/2014, 08:07 PM
Ok, now to the next problem.
The dialog is only 1 anegzeigt .... Screen:
http://s7.directupload.net/images/140404/kdadhqs7.png
but there are actually several loaded from the mysql database:
Dealership car: It 3 dealership cars were loaded.

public LoadAutoHausAutos()
{
new rows, fields, content[MAX_PLAYER_NAME];
cache_get_data(rows, fields);

for(new i = 0; i != rows; i++)
{
cache_get_row(i, 0, content);
AutoHausAuto[i][aaID] = strval(content);

cache_get_row(i, 1, content);
AutoHausAuto[i][aAutoID] = strval(content);
cache_get_row(i, 2, content);
AutoHausAuto[i][aPreis] = strval(content);
cache_get_row(i, 3, content);
AutoHausAuto[i][aBenzin] = strval(content);
cache_get_row(i, 4, content);
AutoHausAuto[i][aBenzinArt] = strval(content);
cache_get_row(i, 5, content);
AutoHausAuto[i][AutoHausID] = strval(content);
}

printf("AutoHausAutos: Dealership car: It %i dealership cars were loaded.", rows);
return 1;
}


code:

new string2[200];
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
if(i == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[i][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Dokins
04/04/2014, 09:23 PM
new string2[200];
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
if(n== 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[i][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");


I think I was right the first time, try that.

MrPlaysino
04/04/2014, 09:31 PM
Ok, Thanks

But:
Show:
http://s7.directupload.net/images/140404/ndw98iqi.png

but i have 3 Cars in the MySQL DB:
And not only Infernus but also other vehicles

Code:
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(n== 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[i][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Dokins
04/04/2014, 09:51 PM
Ahhh Now I understand what your doing!

This should do it!


new string2[200];
new carinrange = 0;
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
carinrange++;
for(new n=1;n<sizeof(AutoHausAuto);n++)
{
if(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

MrPlaysino
04/04/2014, 09:55 PM
Fuuuck Now comes at a time no more dialogue.........

Ok, I see now all the times my codes:
new string2[200];
new carinrange = 0;
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
carinrange++;
for(new n=1;n<sizeof(AutoHausAuto);n++)
{
if(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Loading:
enum:
enum AutoHausAA {
aAutoID,
aaID,
aPreis,
aBenzin,
aBenzinArt,
AutoHausID
}
new AutoHausAuto[MAX_AUTOHAUSAUTO][AutoHausAA];

mysql_function_query(mycon, "SELECT `aaID`,`aAutoID`, `aPreis`, `aBenzin`, `aBenzinArt`,`AutoHausID` FROM `AutoHausAutos`", true, "LoadAutoHausAutos", "", "");


public LoadAutoHausAutos()
{
new rows, fields, content[MAX_PLAYER_NAME];
cache_get_data(rows, fields);

for(new i = 0; i != rows; i++)
{
cache_get_row(i, 0, content);
AutoHausAuto[i][aaID] = strval(content);

cache_get_row(i, 1, content);
AutoHausAuto[i][aAutoID] = strval(content);
cache_get_row(i, 2, content);
AutoHausAuto[i][aPreis] = strval(content);
cache_get_row(i, 3, content);
AutoHausAuto[i][aBenzin] = strval(content);
cache_get_row(i, 4, content);
AutoHausAuto[i][aBenzinArt] = strval(content);
cache_get_row(i, 5, content);
AutoHausAuto[i][AutoHausID] = strval(content);
}

printf("AutoHausAutos: Es wurden %i AutoHausAutos geladen.", rows); //this is in german !!
return 1;
}

Dokins
04/04/2014, 10:02 PM
Okay, I think this should do it now.


new string2[200];
new carinrange = 0;
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
carinrange++;
for(new n=1;n<sizeof(AutoHausAuto);n++)
{
if(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");


Can you actually paste the full thing if this doesn't work, like the entire dialog.

MrPlaysino
04/04/2014, 10:07 PM
Fuck it comes still no dialogue ;((((

new string2[200];
new carinrange = 0;
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
carinrange++;
for(new n=1;n<sizeof(AutoHausAuto);n++)
{
if(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Dokins
04/04/2014, 10:11 PM
Post the full dialog please.

MrPlaysino
04/04/2014, 10:13 PM
What do you mean I have it so when you press the space then a dialog will say:

if(newkeys == KEY_YES)
{
new string2[200];
new carinrange = 0;
for(new i=0;i!=MAX_AUTOHAUS;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,AutoHaus[i][aX],AutoHaus[i][aY],AutoHaus[i][aZ]))
{
carinrange++;
for(new n=1;n<sizeof(AutoHausAuto);n++)
{
if(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");
}

Dokins
04/04/2014, 10:20 PM
if(newkeys == KEY_YES)
{
new string2[200];
new carinrange = 0;
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(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
carinrange++;

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");
}


I'm a moron, it needs to count after it's been created.

MrPlaysino
05/04/2014, 06:37 AM
Ok, now appears also second vehicle. However, there are three in the mysql database. And the rest are then Inferfus why? And I have only three vehicles in the db ....

http://s14.directupload.net/images/140405/modq2snx.png

code:
new string2[200];
new carinrange = 0;
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(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
carinrange++;

}
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Dokins
05/04/2014, 06:46 AM
Show me dialog AUTOHAUS.

MrPlaysino
05/04/2014, 06:49 AM
I currently have only the first time because I wanted to make the.

Dokins
05/04/2014, 06:53 AM
new string2[200];
new carinrange = 0;
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(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
carinrange++;
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");



Whoops, put the ++ inside the loop, that should do the trick.

MrPlaysino
05/04/2014, 06:59 AM
http://s7.directupload.net/images/140405/g87zu3pd.png


Hmmm, Ok, as you can see does not work still. Ok, again from the beginning. I want to make it so you go through a pickup then pressing one space and then a dialog comes with the vehicle list that I do load by mysql.

new string2[200];
new carinrange = 0;
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(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
carinrange++;
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Dokins
05/04/2014, 07:07 AM
Your code confuses me a little:

What does this do?


for(new n=1;n<sizeof(AutoHausAuto);n++)
{


What is AutoHausAuto for?

MrPlaysino
05/04/2014, 07:10 AM
These are the vehicles I will show you times the enum and where I loading:
enum AutoHausAA {
aAutoID,
aaID,
aPreis,
aBenzin,
aBenzinArt,
AutoHausID
}
new AutoHausAuto[MAX_AUTOHAUSAUTO][AutoHausAA];
#define MAX_AUTOHAUSAUTO 100
public LoadAutoHausAutos()
{
new rows, fields, content[MAX_PLAYER_NAME];
cache_get_data(rows, fields);

for(new i = 0; i != rows; i++)
{
cache_get_row(i, 0, content);
AutoHausAuto[i][aaID] = strval(content);

cache_get_row(i, 1, content);
AutoHausAuto[i][aAutoID] = strval(content);
cache_get_row(i, 2, content);
AutoHausAuto[i][aPreis] = strval(content);
cache_get_row(i, 3, content);
AutoHausAuto[i][aBenzin] = strval(content);
cache_get_row(i, 4, content);
AutoHausAuto[i][aBenzinArt] = strval(content);
cache_get_row(i, 5, content);
AutoHausAuto[i][AutoHausID] = strval(content);
}

printf("AutoHausAutos: Es wurden %i AutoHausAutos geladen.", rows); //THIS IS IN GERMAN!
return 1;
}

Dokins
05/04/2014, 07:17 AM
I realise you have two loops, try this:


new string2[200];
new carinrange = 0;
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(carinrange == 1)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
}
carinrange++;
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

MrPlaysino
05/04/2014, 07:21 AM
http://s14.directupload.net/images/140405/mlnatp3c.png

.............. Please help meeeeeeeeeeeeeeeeee

Dokins
05/04/2014, 07:28 AM
I realise that you start one at 0 and the other at 1.

That SHOULD be it.



new string2[200];
new carinrange = 0;
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(carinrange == 0)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}

}
carinrange++;
}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

MrPlaysino
05/04/2014, 07:30 AM
Ok, now when I press space nothing happens.............

Dokins
05/04/2014, 07:33 AM
I'm having difficulty understanding what you really want to do...





new string2[200];
new carinrange = 0;
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(carinrange == 0)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
carinrange++;
}

}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

MrPlaysino
05/04/2014, 07:57 AM
Hello again now from the front.

I have a pickup truck when I go there I have to press Space and then a dialog should open with the vehicles that I have loaded via mysql ....... But now opens no dialogue

new string2[200];
new carinrange = 0;
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(carinrange == 0)
{
format(string2,sizeof string2,"%s",CarName[AutoHausAuto[n][aAutoID] - 400]);
}
else
{
format(string2,sizeof string2,"%s\n%s",string2,CarName[AutoHausAuto[i][aAutoID] - 400]);
}
carinrange++;
}

}
}
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_S TYLE_LIST,"Autohaus",string2,"Weiter","");

Dokins
05/04/2014, 08:19 AM
I don't know what these are for: Can you explain?


for(new n=1;n<sizeof(AutoHausAuto);n++)
{



for(new i=0;i!=MAX_AUTOHAUS;i++)
{

I assume one is max vehicles, but what is the other?

MrPlaysino
05/04/2014, 08:21 AM
This:
for(new n=1;n<sizeof(AutoHausAuto);n++)
{

is for; enum AutoHausAA {
aAutoID,
aaID,
aPreis,
aBenzin,
aBenzinArt,
AutoHausID
}
new AutoHausAuto[MAX_AUTOHAUSAUTO][AutoHausAA];

and this:for(new i=0;i!=MAX_AUTOHAUS;i++)
{

is for: enum AutoHaus2 {
aID,
aPreis,
aBesitzer[MAX_PLAYER_NAME],
aKlasse,
Float:aX, //this
Float:aY,//this
Float:aZ,//this
aGekauft,
Text3D:a3DText,
aCpID
};
new AutoHaus[MAX_AUTOHAUS][AutoHaus2];

Dokins
05/04/2014, 08:31 AM
Could you translate it for me? I don't understand what they're both for.

MrPlaysino
05/04/2014, 08:32 AM
Sry i from germany ;D
Hmm, what you don't understand ?

Dokins
05/04/2014, 08:35 AM
What are the first and second enums actually for, what is there purpose, what do they store, both of them?