Loop & strcat - 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: Loop & strcat - dialog problem (
/showthread.php?tid=497967)
Loop & strcat - dialog problem -
RollingFlow - 01.03.2014
Hey guys, I was wondering why the dialog doesn't appear? Am I doing something wrong, I'm using the dialog on the outside of the loop thus not in it, I really don't see what I'm doing wrong. If someone could help me it'd be awesome
As said, no actual errors, warnings, it's fine really, just that the dialog doesn't appear
Код:
new str[528];
new string[528];
new name[32];
if(IsPlayerConnectedEx(playerid))
{
SCM(playerid, COLOR_RED, "Bugcheck 1:");
for(new i; i != MAX_INVSLOTS; i++)
{
GetItemName(Slots[playerid][i], name, sizeof( name));
SCM(playerid, COLOR_RED, "Bugcheck 2:");
format(str, sizeof(str), "Inventory slot %d: %s - (ID:%d) - Durability: (%d)\n",i,name,Slots[playerid][i],Slots_durability[playerid][i]);
SCM(playerid, COLOR_RED, "Bugcheck 3, formatted str");
}
}
strcat(string, str);
ShowPlayerDialog(playerid, 2481, DIALOG_STYLE_LIST, "Inventory", string, "Select", "Cancel");
SCM(playerid, COLOR_RED, "Bugcheck 4, should appear");
return 1;
Re: Loop & strcat - dialog problem -
Konstantinos - 01.03.2014
If something goes wrong in GetItemName function, it can cause the rest of the code to stop so the dialog won't be displayed either.
Load crashdetect plugin or debug it (print messages in each line).