SA-MP Forums Archive
Problem with strcat in dialogs - 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: Problem with strcat in dialogs (/showthread.php?tid=427320)



Problem with strcat in dialogs - Kestro - 01.04.2013

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


Re: Problem with strcat in dialogs - fiki574 - 01.04.2013

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!


Re: Problem with strcat in dialogs - Denying - 01.04.2013

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


Re: Problem with strcat in dialogs - Kestro - 01.04.2013

That didn't work, any more help?


AW: Problem with strcat in dialogs - Nero_3D - 01.04.2013

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