Problem with dialog [ REP ++] easy but hard to me
#1

FIXED!
Reply
#2

pawn Code:
CMD:myvehicles(playerid,params[])
{
        new string[800];
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
        format(string, sizeof(string), "%s%s\n", string, VehicleNames[playerVariables[playerid][pCarModel2] - 400]);
        format(string, sizeof(string), "%s%s\n", string, VehicleNames[playerVariables[playerid][pCarModel3] - 400]);
        format(string, sizeof(string), "%s%s\n", string, VehicleNames[playerVariables[playerid][pCarModel4] - 400]);
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", string, "Ok", "Close");
        return 1;

}
Try this. Does this method work? If so, Don't forget to rep++ .
Reply
#3

Quote:
Originally Posted by Death1300
View Post
pawn Code:
CMD:myvehicles(playerid,params[])
{
        new string[800];
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
        format(string, sizeof(string), "%s%s\n", string, VehicleNames[playerVariables[playerid][pCarModel2] - 400]);
        format(string, sizeof(string), "%s%s\n", string, VehicleNames[playerVariables[playerid][pCarModel3] - 400]);
        format(string, sizeof(string), "%s%s\n", string, VehicleNames[playerVariables[playerid][pCarModel4] - 400]);
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", string, "Ok", "Close");
        return 1;

}
Try this. Does this method work? If so, Don't forget to rep++ .
Not working, command isn't showing up!
Reply
#4

You are reformatting the same string over and over again.
Format the string and use strcat to add them up to each other.

Like this:
pawn Code:
CMD:myvehicles(playerid,params[])
{
        new sstring[/*Specify size here*/], string[/*Specify size here*/];
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel2] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel3] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel4] - 400]);
        strcat(sstring, string);
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", sstring, "Ok", "Close");
        return 1;
}
Reply
#5

Quote:
Originally Posted by Bible
View Post
You are reformatting the same string over and over again.
Format the string and use strcat to add them up to each other.

Like this:
pawn Code:
CMD:myvehicles(playerid,params[])
{
        new sstring[/*Specify size here*/], string[/*Specify size here*/];
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel2] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel3] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel4] - 400]);
        strcat(sstring, string);
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", sstring, "Ok", "Close");
        return 1;
}
Not working , command isn't showing up. I tried put 800 string to both but nothing happens.
Reply
#6

I rep ++ who helps me 2reps , if i let just 2 strcat's it's showing , i tried to put string to 10,000 and use all 4 strcat's but nothing shows up when i type /myvehicles.
Reply
#7

Why would you use 800 cells? That's way too much and you only need around 30 cells because the max cars you can have are 4 and lets say every car takes around 6-8 cells, approximately 30, let's make it 50 now you can change it later.

pawn Code:
CMD:myvehicles(playerid,params[])
{

        new string[50];
        format(string,sizeof(string),"%s\n%s\n%s\n%s",VehicleNames[playerVariables[playerid][pCarModel1] - 400]
        ,VehicleNames[playerVariables[playerid][pCarModel2] - 400]
        ,VehicleNames[playerVariables[playerid][pCarModel3] - 400]
        ,VehicleNames[playerVariables[playerid][pCarModel4] - 400])
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", string, "Ok", "Close");
        return 1;

}
Tell me the results.

Question: When you type /myvehicles does the dialog show and what's in it is empty or what?
Reply
#8

Quote:
Originally Posted by DaniceMcHarley
View Post
Why would you use 800 cells? That's way too much and you only need around 30 cells because the max cars you can have are 4 and lets say every car takes around 6-8 cells, approximately 30, let's make it 50 now you can change it later.

pawn Code:
CMD:myvehicles(playerid,params[])
{

        new string[50];
        format(string,sizeof(string),"%s\n%s\n%s\n%s",VehicleNames[playerVariables[playerid][pCarModel1] - 400]
        ,VehicleNames[playerVariables[playerid][pCarModel2] - 400]
        ,VehicleNames[playerVariables[playerid][pCarModel3] - 400]
        ,VehicleNames[playerVariables[playerid][pCarModel4] - 400])
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", string, "Ok", "Close");
        return 1;

}
Tell me the results.

Question: When you type /myvehicles does the dialog show and what's in it is empty or what?
The dialog isn't showing..
Reply
#9

removido
Reply
#10

Quote:
Originally Posted by JoshNudock
View Post
removido
Why removed?
Reply
#11

It must works, do this and show result.
Код:
printf("%i %i %i",playerVariables[playerid][pCarModel2],playerVariables[playerid][pCarModel3],playerVariables[playerid][pCarModel4]);
And show us variable VehicleNames.
Reply
#12

Quote:
Originally Posted by PabLo98
Посмотреть сообщение
Try this code below, and just modify the messages.

pawn Код:
CMD:myvehicles(playerid,params[])
{
                new StatsMsg[1000];
                new TitleMsg[128];

                format(StatsMsg, 1000, "Model: %s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
                format(StatsMsg, 1000, "Model: %s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
                format(StatsMsg, 1000, "Model: %s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
                format(TitleMsg, 128, "Your personal vehicles");
                ShowPlayerDialog(playerid, DialogStats, DIALOG_STYLE_LIST, TitleMsg, StatsMsg, "Ok", "Close");
        return 1;

}
It's showing to me only the first vehicle model.
Reply
#13

Guys i am triying to do something with this command but nothing shows up:
pawn Код:
CMD:myvehicles(playerid,params[])
{
        new sstring[10000], string[10000];
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel1] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel2] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel3] - 400]);
        strcat(sstring, string);
        format(string, sizeof(string), "%s\n", VehicleNames[playerVariables[playerid][pCarModel4] - 400]);
        strcat(sstring, string);
        printf("%i %i %i %i",playerVariables[playerid][pCarModel1],playerVariables[playerid][pCarModel2],playerVariables[playerid][pCarModel3],playerVariables[playerid][pCarModel4]);
        ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "Your personal vehicles", sstring, "Ok", "Close");
        return 1;
}
Reply
#14

FIXXXXED!
Reply
#15

Fixed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)