Dialog too long
#1

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;
}
Reply
#2

Why are you using these many spaces?
Reply
#3

Do you think removing space Pawno will compile it?
Reply
#4

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

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.
Reply
#6

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.
Reply
#7

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");
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)