Problem with strcat in dialogs
#1

Hey, so I am having this problem with dialogs where it doesn't show when I do the command:

Код:
command(unimpoundmycar, playerid, params[])
{
	new status[64], string[128], string2[128], string3[128];
 	format(string, sizeof(string), "%s (Impounded).", VehicleNamesNoID[Player[playerid][PlayerCarModel]-399]);
  	format(string2, sizeof(string2), "%s (Impounded).", VehicleNamesNoID[Player[playerid][PlayerCarModel2]-399]);
   	format(string3, sizeof(string3), "%s (Impounded).", VehicleNamesNoID[Player[playerid][PlayerCarModel3]-399]);
    strcat(status, string, 1900 );
    strcat(status, string2, 1900 );
    strcat(status, string3, 1900 );
    ShowPlayerDialog(playerid,4589, DIALOG_STYLE_LIST, "Un-impound your car", status, "Select", "Cancel");
	return 1;
}
Please help, thanks
Reply
#2

pawn Код:
command(unimpoundmycar, playerid, params[])
{
    new status[64], string[128];
    format(string, sizeof(string), "%s (Impounded).\n", VehicleNamesNoID[Player[playerid][PlayerCarModel]-399]);
    strcat(status, string);
    format(string, sizeof(string), "%s (Impounded).\n", VehicleNamesNoID[Player[playerid][PlayerCarModel2]-399]);
    strcat(status, string);
    format(string, sizeof(string), "%s (Impounded).\n", VehicleNamesNoID[Player[playerid][PlayerCarModel3]-399]);
    strcat(status, string);
    ShowPlayerDialog(playerid,4589, DIALOG_STYLE_LIST, "Un-impound your car", status, "Select", "Cancel");
    return 1;
}
No need for 3 strings!
Reply
#3

lol nvm, I didn't really read the problem.
Reply
#4

That didn't work, any more help?
Reply
#5

Are you sure that PlayerCarModel 1 - 3 are over 399?
Or is it possible that the player only got 2 vehicles and one variable is unused ?

Why 399 and not 400 ?, the first vehicle modelid is 400.
You also could use an array for PlayerCarModel.
Do you want to show all even if one variable is unused ?

Also why is the status array smaller than the string...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)