SA-MP Forums Archive
[HELP]Input Line too Long - 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: [HELP]Input Line too Long (/showthread.php?tid=503218)



[HELP]Input Line too Long - donhu789 - 28.03.2014

pawn Код:
else if(count == 9)
    {
        format(slots, sizeof(slots), "Vehicle 1: %s\nVehicle 2: %s\nVehicle 3: %s\nVehicle 4: %s\nVehicle 5: %s\nVehicle 6: %s\nVehicle 7: %s\nVehicle 8: %s\nVehicle 9: %s",
        GlobalVehicleNames[Vehicle_Data_Model[playerid][0] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][1] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][2] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][3] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][4] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][5] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][6] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][7] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][8] - 400]);
        ShowPlayerDialog(playerid, MY_VEHS_MENU, DIALOG_STYLE_LIST, "{FFFFFF}Owned Vehicle List", slots, "Locate", "Cancel");
    }
Input Line To Long can anyone help me to fix it ?


Re: [HELP]Input Line too Long - RajatPawar - 28.03.2014

Код:
Input Line
- entered code line

Код:
too long
- umm... too long??

So.. I can't imagine what the fix might be!

A typed code line is too long. Shorten it!


Re: [HELP]Input Line too Long - donhu789 - 28.03.2014

i can't :\ because players will not under stand what the fuck is that =)


Re: [HELP]Input Line too Long - PT - 28.03.2014

pawn Код:
else if(count == 9)
{
    new PT[100], PT2[100];
   
    format(PT2, sizeof(PT2), "Vehicle 1: %s\nVehicle 2: %s\nVehicle 3: %s", GlobalVehicleNames[Vehicle_Data_Model[playerid][0] - 400]\n, GlobalVehicleNames[Vehicle_Data_Model[playerid][1] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][2] - 400]);
    strcat(PT, PT2, sizeof(PT));

    format(PT2, sizeof(PT2), "Vehicle 4: %s\nVehicle 5: %s\nVehicle 6: %s\n", GlobalVehicleNames[Vehicle_Data_Model[playerid][3] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][4] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][5] - 400]);
    strcat(PT, PT2, sizeof(PT));

    format(PT2, sizeof(PT2), "Vehicle 7: %s\nVehicle 8: %s\nVehicle 9: %s", GlobalVehicleNames[Vehicle_Data_Model[playerid][6] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][7] - 400], GlobalVehicleNames[Vehicle_Data_Model[playerid][8] - 400);
    strcat(PT, PT2, sizeof(PT));
   
    ShowPlayerDialog(playerid, MY_VEHS_MENU, DIALOG_STYLE_LIST, "{FFFFFF}Owned Vehicle List", PT, "Locate", "Cancel");

}



Re: [HELP]Input Line too Long - Vince - 28.03.2014

I hardly think that the string itself is the culprit, but rather the amount of variables and the length of their names. Try to spread it out over multiple lines, like so:
pawn Код:
format
(
    slots, sizeof(slots), "Vehicle 1: %s\nVehicle 2: %s\nVehicle 3: %s\nVehicle 4: %s\nVehicle 5: %s\nVehicle 6: %s\nVehicle 7: %s\nVehicle 8: %s\nVehicle 9: %s",
    GlobalVehicleNames[Vehicle_Data_Model[playerid][0] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][1] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][2] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][3] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][4] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][5] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][6] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][7] - 400],
    GlobalVehicleNames[Vehicle_Data_Model[playerid][8] - 400]
);
Easier on the eyes as well.