[NeedHelp]: Dialog
#1

Код:
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57349) : error 075: input line too long (after substitutions)
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : warning 215: expression has no effect
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : error 001: expected token: ";", but found "\"
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : fatal error 107: too many error messages on one line
Код:
                else if(PlayerInfo[playerid][pGPS] == 1)
                 {
                    new list[] = "1\tArmy HQ\n2\tLicenses Center\n3\tOff Road Dealership\n4\tCar Graveyard\n5\tCoutz And Shoutz\n6\tABC Studio\n7\tFBI HQ\n8\tAmmunation\n9\tHosptial\n10\tGROTTI\n11\tRPL\n12\tLSFD\n13\tLowriderz Dealership\n14\tCity Hall\n15\tLSPD\n16\tTaxi Co. HQ\n17\tArms Dealer Job\n18\tBoats Dealership\n19\tTrucks Dealership\n20\tSF Docks\n21\tLVAP Deliver\n22\tMaterials Bank\n23\tDrug Dealer Job\n24\tDrugs Bank\n25\tDrugs Bank 2\n26\t Drugs Farmer\n27\t Materials Smuggler Job\n28\tMaterials Factory)";
                    ShowPlayerDialog(playerid, 1241,DIALOG_STYLE_LIST,"G.P.S Positions",list,"Track","Off");
                    SendClientMessage(playerid, COLOR_GREY,"* You have a GPS Addon, displaying illegal jobs positions and others with the GPS Addon.");
                    SendClientMessage(playerid, COLOR_GREY,"* To turn the GPS Off, type /gps again and select off or type /gpsfind 0 0 0");
                }

I need to fit all "new list" into 1 dialog.. Can any1 please help .. Tried everything .. But im pretty newbie in pawno ..
Reply
#2

pawn Код:
else if(PlayerInfo[playerid][pGPS] == 1)
{
    ShowPlayerDialog(playerid, 1241, DIALOG_STYLE_LIST,
        "G.P.S Positions",
        "1\tArmy HQ \
        \n2\tLicenses Center \
        \n3\tOff Road Dealership \
        \n4\tCar Graveyard \
        \n5\tCoutz And Shoutz \
        \n6\tABC Studio \
        \n7\tFBI HQ \
        \n8\tAmmunation \
        \n9\tHosptial \
        \n10\tGROTTI \
        \n11\tRPL \
        \n12\tLSFD \
        \n13\tLowriderz Dealership \
        \n14\tCity Hall \
        \n15\tLSPD \
        \n16\tTaxi Co. HQ \
        \n17\tArms Dealer Job \
        \n18\tBoats Dealership \
        \n19\tTrucks Dealership \
        \n20\tSF Docks \
        \n21\tLVAP Deliver \
        \n22\tMaterials Bank \
        \n23\tDrug Dealer Job \
        \n24\tDrugs Bank \
        \n25\tDrugs Bank 2 \
        \n26\tDrugs Farmer \
        \n27\tMaterials Smuggler Job \
        \n28\tMaterials Factory"
,
        "Track", "Off");
       
    SendClientMessage(playerid, COLOR_GREY,"* You have a GPS Addon, displaying illegal jobs positions and others with the GPS Addon.");
    SendClientMessage(playerid, COLOR_GREY,"* To turn the GPS Off, type /gps again and select off or type /gpsfind 0 0 0");
}
Reply
#3

Код:
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350 -- 57376) : error 075: input line too long (after substitutions)
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57377) : warning 217: loose indentation
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57377) : warning 215: expression has no effect
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57377) : error 001: expected token: ";", but found "\"
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57377) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57377) : error 017: undefined symbol "tArmy"
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57377) : fatal error 107: too many error messages on one line
pawn Код:
else if(PlayerInfo[playerid][pGPS] == 1)
                 {
                    ShowPlayerDialog(playerid, 1241, DIALOG_STYLE_LIST,
                        "G.P.S Positions",
                        "1\tArmy HQ \
                        \n2\tLicenses Center \
                        \n3\tOff Road Dealership \
                        \n4\tCar Graveyard \
                        \n5\tCoutz And Shoutz \
                        \n6\tABC Studio \
                        \n7\tFBI HQ \
                        \n8\tAmmunation \
                        \n9\tHosptial \
                        \n10\tGROTTI \
                        \n11\tRPL \
                        \n12\tLSFD \
                        \n13\tLowriderz Dealership \
                        \n14\tCity Hall \
                        \n15\tLSPD \
                        \n16\tTaxi Co. HQ \
                        \n17\tArms Dealer Job \
                        \n18\tBoats Dealership \
                        \n19\tTrucks Dealership \
                        \n20\tSF Docks \
                        \n21\tLVAP Deliver \
                        \n22\tMaterials Bank \
                        \n23\tDrug Dealer Job \
                        \n24\tDrugs Bank \
                        \n25\tDrugs Bank 2 \
                        \n26\tDrugs Farmer \
                        \n27\tMaterials Smuggler Job \
                        \n28\tMaterials Factory"
,
                        "Track", "Off");
                    SendClientMessage(playerid, COLOR_GREY,"* You have a GPS Addon, displaying illegal jobs positions and others with the GPS Addon.");
                    SendClientMessage(playerid, COLOR_GREY,"* To turn the GPS Off, type /gps again and select off or type /gpsfind 0 0 0");
                }
EDIT:: AT the beginning there was code like that .. But it didnt work . I saw only till \n16\tTaxi Co. HQ"; :
pawn Код:
else if(PlayerInfo[playerid][pGPS] == 1)
                {
                    new superstring[491];
                    new list[] = "1\tArmy HQ\n2\tLicenses Center\n3\tOff Road Dealership\n4\tCar Graveyard\n5\tCoutz And Shoutz\n6\tABC Studio\n7\tFBI HQ\n8\tAmmunation\n9\tHosptial\n10\tGROTTI\n11\tRPL\n12\tLSFD\n13\tLowriderz Dealership\n14\tCity Hall\n15\tLSPD\n16\tTaxi Co. HQ";
                    new list2[] = "\n17\tArms Dealer Job\n18\tBoats Dealership\n19\tTrucks Dealership\n20\tSF Docks\n21\tLVAP Deliver\n22\tMaterials Bank\n23\tDrug Dealer Job\n24\tDrugs Bank\n25\tDrugs Bank 2\n26\t Drugs Farmer\n27\t Materials Smuggler Job\n28\tMaterials Factory";
                    format(superstring,sizeof(superstring),"%s%s",list,list2);
                    ShowPlayerDialog(playerid, 1241,DIALOG_STYLE_LIST,"G.P.S Positions",list,"Track","Off");
                    SendClientMessage(playerid, COLOR_GREY,"* You have a GPS Addon, displaying illegal jobs positions and others with the GPS Addon.");
                    SendClientMessage(playerid, COLOR_GREY,"* To turn the GPS Off, type /gps again and select off or type /gpsfind 0 0 0");
                }
Reply
#4

This is very stupid way to do this IMO, but seems that compiler doesn't like long input lines. lol

I couldn't find any pragmas to lengthen the input lines neither, it's weird.

pawn Код:
new string[512];
   
    strcat(string,
        "1\tArmy HQ \
        \n2\tLicenses Center \
        \n3\tOff Road Dealership \
        \n4\tCar Graveyard \
        \n5\tCoutz And Shoutz \
        \n6\tABC Studio \
        \n7\tFBI HQ \
        \n8\tAmmunation \
        \n9\tHosptial \
        \n10\tGROTTI"
, sizeof(string));
       
    strcat(string,
        "\n11\tRPL \
        \n12\tLSFD \
        \n13\tLowriderz Dealership \
        \n14\tCity Hall \
        \n15\tLSPD \
        \n16\tTaxi Co. HQ \
        \n17\tArms Dealer Job \
        \n18\tBoats Dealership \
        \n19\tTrucks Dealership \
        \n20\tSF Docks"
, sizeof(string));
       
    strcat(string,
        "\n21\tLVAP Deliver \
        \n22\tMaterials Bank \
        \n23\tDrug Dealer Job \
        \n24\tDrugs Bank \
        \n25\tDrugs Bank 2 \
        \n26\tDrugs Farmer \
        \n27\tMaterials Smuggler Job \
        \n28\tMaterials Factory"
, sizeof(string));
   
    ShowPlayerDialog(playerid, 1241, DIALOG_STYLE_LIST, "G.P.S Positions", string, "Track", "Off");
Reply
#5

Everything works now in game .. But ..

Код:
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : warning 219: local variable "string" shadows a variable at a preceding level
Line 57350 =
pawn Код:
new string[512];
Reply
#6

Change 'string' to 'str' (or anthing else just not 'string' or the name of another global variable) the warning is because of another variable with the same name.
Reply
#7

Thank You Very much Finn and iggy1 . Everything work fine now ..
Reply
#8

Quote:
Originally Posted by Trooja
Посмотреть сообщение
Код:
C:\Documents and Settings\Trooja\Desktop\ser 0.3\gamemodes\larp.pwn(57350) : warning 204: symbol is assigned a value that is never used: "str"
I tried #define MAX_STR 512 , doesnt work .

E::: WAIT .. Got an idea .. Testing
You have to change string inside all of the strcat as well. I ran in to this problem myself when attempting to hard code a lengthy SQL query. Would be interested to know if anyone found a better solution.
Reply
#9

Yeah .. I noticed that after i posted ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)