SA-MP Forums Archive
Dialog too long - 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 too long (/showthread.php?tid=631324)



Dialog too long - Face9000 - 26.03.2017

I have this dialog but seems too long and cant compile. I know i have to use strcat but idk how to do it with the DIALOG_STYLE_LIST

pawn Код:
CMD:obj(playerid)
{
    if (Player[playerid][Vip] < 1)
    {
        ShowPlayerDialog(playerid,DIALOG_VIP_OBJECTS,DIALOG_STYLE_LIST,"Hold Objects","SantaHat               \nParrot               \nParrot-Man               \nHippo               \nMotorCycleHelmet               \nCapBack                \nGlasses                \nSmokeFlare                \nSphere1                \nSphere2                \nSphere3                \nBalon               \nIron               \nAlien               \nIcread               \n{ffff12}Weaponaizer              \nRemove Hold Objects","Ok","Close");
    }
    return 1;
}



Re: Dialog too long - Toroi - 26.03.2017

Why are you using these many spaces?


Re: Dialog too long - Face9000 - 27.03.2017

Do you think removing space Pawno will compile it?


Re: Dialog too long - Toroi - 27.03.2017

Yes. Why are the spaces there anyway, I see no point.


Re: Dialog too long - verlaj - 27.03.2017

Use strcat for very long dialogs. E.g

New dialogstr(12;
Strcat(dialogstr,"Van\n");
Strcat(dialogstr,"van2\n");

Then use dialogstr in the ShowDialog instead.

Edit: tho i have heard memcpy is faster than strcat.


Re: Dialog too long - Yuri8 - 27.03.2017

Hey, to do this you need to remove spaces like this:
PHP код:
CMD:obj(playerid)
{
    if (
Player[playerid][Vip] < 1)
    {
        
ShowPlayerDialog(playerid,DIALOG_VIP_OBJECTS,DIALOG_STYLE_LIST,"Hold Objects","Santa Hat\nParrot\nParrot-Man\nHippo\nMotorCycleHelmet\nCapBack\nGlasse\nSmokeFlare\nSphere1\nSphere2\nSphere3\nBalon\nIron\nAlien\nIcread\n{ffff12}Weaponaizer\nRemove Hold Objects","Ok","Close");
    }
    return 
1;

I hope I helped.


Re: Dialog too long - LazzyBoy - 27.03.2017

You also can create a string and show the string into dialog

Код:
new string[128];
format(string,sizeof(string),"Whatever you need here");
ShowPlayerDialog(playerid,dialogid,dialogstyle,"Hold Objects",string,"Click","Cancel");



Re: Dialog too long - Hackzzzz - 27.03.2017

Try this:
http://pawntools.ml/?hash=lD7Buz