String issues
#1

Hmm my problem is this

Example:

Код:
new string[5000];
I put this in my
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
Now I have a list of interiors as a dialogmenu , It's a really long list so when my admins do the command to go to a interior a menu should be popping up as a list of interiors , There is a total of 50 interiors on this dialog list , Now when I have the new string[5000]; Dosn't show the dialogbox but when i lower the string to like lets say new string[2000] but it only displays around half of the interiors on the list. So when i change it back to new string[5000]; the list dosnt even come up but when the string is set to 2000 only half of what comes up ? How to make the entire thing come up ?
Reply
#2

Show use the command / dialog.
Reply
#3

Код:
if(strcmp(cmd, "/phint", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
             if(PlayerInfo[playerid][pAdmin] >= 1337)
             {
                 ShowPlayerDialog(playerid,DPHINT,DIALOG_STYLE_LIST,"Property House - Interiors","Interior 1\nInt2\nInt3\nInt4\nInt5\nInt6\nInt7\nInt8\nInt8\nInt9\nInt10\nInt11\nInt12\nInt13\nInt14\nInt15\nInt16\Int17\Int18\nInt20\nInt21\nInt22","Select","Exit");
             }
             else
             {
				 SendClientMessage(playerid,COLOR_YELLOW,"You are not admin");
             }
        }
		return 1;
	}
Reply
#4

First: Don't alter the OnDialogResponse callback.
Second: I know you aren't getting any errors but try this:

pawn Код:
if(strcmp(cmd, "/phint", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pAdmin] >= 1337)
        {
            new s[150]; // I'm gonna use strcat so it has to be more than 128 and it's a dialog -_-
            strcat(s,"Interior 1\nInt2\nInt3\nInt4\nInt5\nInt6\nInt7\nInt8\nInt8\nInt9\nInt10\nInt11\nInt12\nInt13\nInt14\nInt15\nInt16\Int17\Int18\nInt20\nInt21\nInt22");
            ShowPlayerDialog(playerid,DPHINT,DIALOG_STYLE_LIST,"Property House - Interiors",s,"Select","Exit");
        }
        else
        {
            SendClientMessage(playerid,COLOR_YELLOW,"You are not admin");
        }
    }
    return 1;
Reply
#5

Thats not the problem tho , Why is it when I type the command and the string is over a certain amount it dosnt work ?

if i set the string to like 5000 it does not work but if I change the string number to around 2950 it shows the menu but only half is what is listed ? Understand what I am saying ? Is it to much string for sa-mp ? is there some plugin i could use or what
Reply
#6

I too also have the same problem , I would like to know a solution
Reply
#7

String 5000?!?!?! WTF BOOOM!

2000 shows half? 2+2 = 4, try 4000.
Reply
#8

Make commands like /interiors1 , /interiors2 and so on
Reply
#9

How big of a string would you use of 201 lines ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)