Dialog Splitting
#1

So i have this code:

PHP код:
    case 12// Normal Vehicles
{
            
ShowPlayerDialog(playerid12DIALOG_STYLE_LIST"Normal Vehicles""Phoenix ($125,000)\nzr350 ($125,000)\nPremier ($90,000)\nAlpha ($85,000)\nElegant ($80,000)\nStafford ($80,000)\nWashington ($70,000)\nHustler ($55,000)\nSabre ($50,000)\nBlista Compact ($50,000)\nAdmiral ($50,000)\nYosemite ($45,000)\nFeltzer ($45,000)\nMerit ($40,000)\nVincent ($40,000)\nBuccaneer ($40,000)\nClub ($40,000)\nTahoma ($40,000)\nSunrise ($40,000)\nGreenwood ($40,000)\nSentinel ($40,000)\nOceanic ($35,000)\nBurrito ($35,000)\nMajestic ($30,000)\nNebula ($30,000)\nVirgo ($30,000)\nGlendale ($30,000)\nSolair ($30,000)\nManana ($25,000)\nRegina ($25,000)\nSadler ($20,000)\nWalton ($15,000)\nClover ($5,000)\nTampa ($5,000)""Choose""Cancel");
        } 
On compile i get this so i am sure that the problem is with splitting but i dunno how to do it ;/
PHP код:
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32793) : error 075input line too long (after substitutions)
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : error 037invalid string (possibly non-terminated string)
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : warning 215expression has no effect
C
:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : warning 215expression has no effect
C
:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : error 001expected token";"but found ")"
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : error 029invalid expressionassumed zero
C
:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

Reply
#2

so i should say you are wrong because it's not for spliting it's for how long is you line
you should use strcat to make this long dialog
Reply
#3

Can you show me an example ?:/ I ain't that good at this ;/

Why should i define car names ?

PHP код:
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32793) : error 075input line too long (after substitutions)
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : error 037invalid string (possibly non-terminated string)
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : error 017undefined symbol "Phoenix"
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : warning 215expression has no effect
C
:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : warning 215expression has no effect
C
:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : error 001expected token";"but found ")"
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

Reply
#4

Aight so you mean it like this ?
If so then i have problem.

PHP код:
        case 12// Normal Vehicles
        
{
        new 
string[256];
        
strcat(string"\nPhoenix ($125,000)\nzr350 ($125,000)\nPremier ($90,000)\nAlpha ($85,000)\nElegant ($80,000)\nStafford ($80,000)\nWashington ($70,000)\nHustler ($55,000)\nSabre ($50,000)\nBlista Compact ($50,000)\nAdmiral ($50,000)\nYosemite ($45,000)");
        
strcat(string"\nFeltzer ($45,000)\nMerit ($40,000)\nVincent ($40,000)\nBuccaneer ($40,000)\nClub ($40,000)\nTahoma ($40,000)\nSunrise ($40,000)\nGreenwood ($40,000)\nSentinel ($40,000)\nOceanic ($35,000)\nBurrito ($35,000)\nMajestic ($30,000)\nNebula ($30,000)");
        
strcat(string"\nVirgo ($30,000)\nGlendale ($30,000)\nSolair ($30,000)\nManana ($25,000)\nRegina ($25,000)\nSadler ($20,000)\nWalton ($15,000)\nClover ($5,000)\nTampa ($5,000)");
        
ShowPlayerDialog(playerid12DIALOG_STYLE_LIST"Normal Vehicles"string"Choose""Cancel");
        } 
How to fix this ?
PHP код:
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : warning 219local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase 
Reply
#5

just delete this:
Код:
new string[256];
Reply
#6

Deleting new string wouldn't work.
Rename new string[256]; to new str[256];
Reply
#7

Fixed it on my own by makeing a new case and section on dialog popup. Anyways thanks for the help guys
Reply
#8

pawn Код:
#define First 1
if(dialogid == First)
{
//Code
return 1;
}
It's Better Form case
Reply
#9

You are using wrong symbol this /n should be replcaed with this \n

Use ALT + 092 to do that symbol


REP + If helped.
Reply
#10

Quote:
Originally Posted by weedxd
Посмотреть сообщение
Aight so you mean it like this ?
If so then i have problem.

PHP код:
        case 12// Normal Vehicles
        
{
        new 
string[256];
        
strcat(string"\nPhoenix ($125,000)\nzr350 ($125,000)\nPremier ($90,000)\nAlpha ($85,000)\nElegant ($80,000)\nStafford ($80,000)\nWashington ($70,000)\nHustler ($55,000)\nSabre ($50,000)\nBlista Compact ($50,000)\nAdmiral ($50,000)\nYosemite ($45,000)");
        
strcat(string"\nFeltzer ($45,000)\nMerit ($40,000)\nVincent ($40,000)\nBuccaneer ($40,000)\nClub ($40,000)\nTahoma ($40,000)\nSunrise ($40,000)\nGreenwood ($40,000)\nSentinel ($40,000)\nOceanic ($35,000)\nBurrito ($35,000)\nMajestic ($30,000)\nNebula ($30,000)");
        
strcat(string"\nVirgo ($30,000)\nGlendale ($30,000)\nSolair ($30,000)\nManana ($25,000)\nRegina ($25,000)\nSadler ($20,000)\nWalton ($15,000)\nClover ($5,000)\nTampa ($5,000)");
        
ShowPlayerDialog(playerid12DIALOG_STYLE_LIST"Normal Vehicles"string"Choose""Cancel");
        } 
How to fix this ?
PHP код:
C:\Users\WeeD\Desktop\HTLS-RP\gamemodes\HTLS-RP.pwn(32794) : warning 219local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase 
That code should work perfectly.

pawn Код:
case 12: // Normal Vehicles
        {
        new str2[650];
        strcat(str2, "\nPhoenix ($125,000)\nzr350 ($125,000)\nPremier ($90,000)\nAlpha ($85,000)\nElegant ($80,000)\nStafford ($80,000)\nWashington ($70,000)\nHustler ($55,000)\nSabre ($50,000)\nBlista Compact ($50,000)\nAdmiral ($50,000)\nYosemite ($45,000)");
        strcat(str2, "\nFeltzer ($45,000)\nMerit ($40,000)\nVincent ($40,000)\nBuccaneer ($40,000)\nClub ($40,000)\nTahoma ($40,000)\nSunrise ($40,000)\nGreenwood ($40,000)\nSentinel ($40,000)\nOceanic ($35,000)\nBurrito ($35,000)\nMajestic ($30,000)\nNebula ($30,000)");
        strcat(str2, "\nVirgo ($30,000)\nGlendale ($30,000)\nSolair ($30,000)\nManana ($25,000)\nRegina ($25,000)\nSadler ($20,000)\nWalton ($15,000)\nClover ($5,000)\nTampa ($5,000)");
        ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Normal Vehicles", str2, "Choose", "Cancel");
        }
I've also incremented the array size, 256 is too small for such large text.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)