Cant add more cars here
#1

Код:
	        case 0://Sports Cars
	        {
	            ShowPlayerDialog(playerid, NVM_CARS, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - Sports Cars", "{FFFFFF}Vehicle: Infernus - Price: $2M\nVehicle: Bullet - Price: $2M\nVehicle: Comet - Price: $2M\nVehicle: Banshee - Price: $1M\nVehicle: Super-GT - Price: $1M\nVehicle: Sultan - Price: $800K\nVehicle: Cheetah - Price: $5M\nVehicle: Turismo - Price: $5M\nVehicle: Stretch - Price: $8M\nVehicle: Hotknife - Price: $6M\nVehicle: Blade - Price: $2M\nVehicle: Jester - Price: $2M\nVehicle: Elegy - Price: $800K", "Buy", "Cancel");
	            return 1;
	        }
when i add more cars in it it says
Код:
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(9000) : error 075: input line too long (after substitutions)
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(9001) : error 037: invalid string (possibly non-terminated string)
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(9001) : error 017: undefined symbol "FFFFFF"
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(9001) : warning 217: loose indentation
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(9001) : error 017: undefined symbol "Infernus"
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(9001) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

use strcat

https://sampforum.blast.hk/showthread.php?pid=1812083#pid1812083
Reply
#3

i used but when i click on sports cars nothing opens :P thts y i removed
Reply
#4

pawn Код:
error 075: input line too long
pawn Код:
case 0://Sports Cars
            {
                ShowPlayerDialog(playerid, NVM_CARS, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - Sports Cars", "{FFFFFF}Vehicle: Infernus - Price: $2M\nVehicle: Bullet - Price: $2M\nVehicle: Comet - Price: $2M\nVehicle: Banshee - Price: $1M\nVehicle: Super-GT - Price: $1M\nVehicle: Sultan - Price: $800K\
\nVehicle: Cheetah - Price: $5M\nVehicle: Turismo - Price: $5M\nVehicle: Stretch - Price: $8M\
\nVehicle: Hotknife - Price: $6M\nVehicle: Blade - Price: $2M\nVehicle: Jester - Price: $2M\
\nVehicle: Elegy - Price: $800K"
, "Buy", "Cancel");
                return 1;
            }
Try this
Reply
#5

example with strcat

pawn Код:
case 0://Sports Cars
{
    new pDialog[800]; //change if you increase the cars
    strcat(pDialog, "Vehicle: Infernus - Price: $2M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Bullet - Price: $2M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Comet - Price: $2M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Banshee - Price: $1M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Super-GT - Price: $1M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Sultan - Price: $800K\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Cheetah - Price: $5M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Turismo - Price: $5M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Stretch - Price: $8M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Hotknife - Price: $6M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Blade - Price: $2M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Jester - Price: $2M\n", sizeof(pDialog));
    strcat(pDialog, "Vehicle: Elegy - Price: $800K", sizeof(pDialog));
    ShowPlayerDialog(playerid, NVM_CARS, DIALOG_STYLE_LIST, "{FFFFFF}New Vegas Motors - Sports Cars", pDialog, "Buy", "Cancel");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == NVM_CARS)
    {
        if(response == 1)
        {
            switch(listitem)
            {
                case 0:
                {
                                  //Here Code
                }
                case 1:
                {
                                //Here Code
                }
                case 2:
                {
                                //Here Code
                }
                case 3:
                {
                               //Here Code
                }
                case 4:
                {
                              //Here Code
                }
                case 5:
                {
                            //Here Code
                }
                case 6:
                {
                            //Here Code
                }
                case 7:
                {
                            //Here Code
                }
                case 8:
                {
                            //Here Code
                }
                case 9:
                {
                            //Here Code
                }
                case 10:
                {
                            //Here Code
                }
                case 11:
                {
                            //Here Code
                }
                case 12:
                {
                            //Here Code
                }
            }
        }
        if(response == 0) return 0;
    }
    return 1;
}
Reply
#6

Brother, you have to read this tutorial : Click here

I hope that it will work! and you'll understand that how and when to use string length a.k.a string[string_size] or String[index]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)