Input Line too long
#1

Hey Guys, i have a Error " error 075: input line too long (after substitutions)" in this Line "ShowPlayerDialog":

Код:
COMMAND:weapons(playerid,params[])
{
	if(PlayerTeam[playerid] != TEAM_HUMAN) return SendClientMessage(playerid,COLOR_RED,"You are not an Human-Member!");
	
	ShowPlayerDialog(playerid,DIALOG_WEAPONS,DIALOG_STYLE_LIST,"Weapon-Menu","9mm's - $250\nSilenced 9mm - $500\nSawnOff - $30000\nCombat Shotgun - $1500\nMicro UZIs - $2000\nMP5 - $2500\nAK47 - $3000\nCountry Rifle - $5000\nSniper Rifle - $15000\nArmour - $20000\nFlamethrower - $700000\nSpraycan - $10000\nKatana - $500\nTec9 - $400\nDildo - $5\nBaseball Bat - $1000\nFlowers - $30\nSatchel Charges - $300000\nGrenades - $100000\nChainsaw - $15000\nFire Extinguisher - $15000\nRocket Launcher - $200000\nMinigun - $500000","OKAY","CANCEL");
	return 1;
}
Know everyone an Answer?
Reply
#2

Use strcat

https://sampwiki.blast.hk/wiki/Strcat
Reply
#3

I understand this not, what must i now make with strcat?
Reply
#4

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
I understand this not, what must i now make with strcat?
pawn Код:
new string[512];
strcat(string,"9mm's - $250\nSilenced 9mm - $500\nSawnOff - $30000\nCombat Shotgun - $1500\nMicro UZIs - $2000\nMP5 - $2500\nAK47 - $3000\n");
strcat(string,"Country Rifle - $5000\nSniper Rifle - $15000\nArmour - $20000\nFlamethrower - $700000\nSpraycan - $10000\n");
strcat(string,"Katana - $500\nTec9 - $400\nDildo - $5\nBaseball Bat - $1000\nFlowers - $30\nSatchel Charges - $300000\n");
strcat(string,"Grenades - $100000\nChainsaw - $15000\nFire Extinguisher - $15000\nRocket Launcher - $200000\nMinigun - $500000");
ShowPlayerDialog(playerid,DIALOG_DOWEAPONS,DIALOG_STYLE_LIST,"Weapon-Menu",string,"OKAY","CANCEL");
Reply
#5

Код:
COMMAND:weapons(playerid,params[])
{
	if(PlayerTeam[playerid] != TEAM_HUMAN) return SendClientMessage(playerid,COLOR_RED,"You are not an Human-Member!");
	
    new string[164] = "9mm's - $250\nSilenced 9mm - $500\nSawnOff - $30000\nCombat Shotgun - $1500\nMicro UZIs - $2000\nMP5 - $2500\nAK47 - $3000\n";
    strcat(string,"Country Rifle - $5000\nSniper Rifle - $15000\nArmour - $20000\nFlamethrower - $700000\nSpraycan - $10000\nKatana - $500\nTec9 - $400\nDildo - $5\nBaseball Bat - $1000\nFlowers - $30\nSatchel Charges - $300000\nGrenades - $100000\nChainsaw - $15000\nFire Extinguisher - $15000\nRocket Launcher - $200000\nMinigun - $500000");
    ShowPlayerDialog(playerid,DIALOG_WEAPONS,DIALOG_STYLE_LIST,"Weapon-Menu",string,"Okay","Cancel");
    return 1;
}
Thx, is that so right?
Reply
#6

I modified the code.. put that in.. the first code was a mistake
Reply
#7

It works, thx, i give you +1 Rep.
Reply
#8

Just do it like that, move the long line in a seperated one (without commas)!
pawn Код:
//
    ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapon-Menu",
        "9mm's - $250\nSilenced 9mm - $500\nSawnOff - $30000\nCombat Shotgun - $1500\nMicro UZIs - $2000\nMP5 - $2500\nAK47 - $3000\nCountry Rifle - $5000\nSniper Rifle - $15000\nArmour - $20000\nFlamethrower - $700000\nSpraycan - $10000\nKatana - $500\nTec9 - $400\nDildo - $5\nBaseball Bat - $1000\nFlowers - $30\nSatchel Charges - $300000\nGrenades - $100000\nChainsaw - $15000\nFire Extinguisher - $15000\nRocket Launcher - $200000\nMinigun - $500000"
            , "OKAY", "CANCEL");
That will work because every seperated line gets his own limit (around ~500 char), you text is only 447 char long

If you go over the limit DONT use strcat, just use global variables
Because if you use strcat you do nothing else than contracting global saved data
With a global variable you dont need to contract if afterwards!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)