new vehicles[9000];
strcat(vehicles, "{FFFFFF}Admiral \n{FFFFFF}Alpha \n{FFFFFF}Ambulance\n{FFFFFF}Baggage \n{FFFFFF}Bandito \n{FFFFFF}Banshee \n{FFFFFF}Barracks \n{FFFFFF}Beagle \n{FFFFFF}Benson \n{FFFFFF}BF-400 ");
strcat(vehicles, "\n{FFFFFF}BF Injection \n{FFFFFF}Bike \n{FFFFFF}Blade \n{FFFFFF}Blista Compact \n{FFFFFF}Bloodring Banger \n{FFFFFF}BMX \n{FFFFFF}Bobcat \n{FFFFFF}Boxville \n{FFFFFF}Bravura \n{FFFFFF}Broadway \n{FFFFFF}Buccaneer \n{FFFFFF}Buffalo ");
strcat(vehicles, "\n{FFFFFF}Bullet \n{FFFFFF}Burrito \n{FFFFFF}Bus \n{FFFFFF}Cabbie \n{FFFFFF}Caddy \n{FFFFFF}Cadrona \n{FFFFFF}Camper \n{FFFFFF}Cargobob \n{FFFFFF}Cement Truck \n{FFFFFF}Cheetah \n{FFFFFF}Clover \n{FFFFFF}Club ");
strcat(vehicles, "\n{FFFFFF}Coach \n{FFFFFF}Coastguard \n{FFFFFF}Combine Harvester \n{FFFFFF}Comet \n{FFFFFF}Cropduster \n{FFFFFF}DFT-30 \n{FFFFFF}Dinghy \n{FFFFFF}Dodo \n{FFFFFF}Dozer \n{FFFFFF}Dumper \n{FFFFFF}Dune \n{FFFFFF}Elegant ");
strcat(vehicles, "\n{FFFFFF}Elegy \n{FFFFFF}Emperor \n{FFFFFF}Enforcer \n{FFFFFF}Esperanto \n{FFFFFF}Euros \n{FFFFFF}Faggio \n{FFFFFF}FBI Rancher \n{FFFFFF}FBI Truck ");
strcat(vehicles, "\n{FFFFFF}FCR-900 \n{FFFFFF}Feltzer \n{FFFFFF}Firetruck\n{FFFFFF}Flash \n{FFFFFF}Flatbed \n{FFFFFF}Forklift \n{FFFFFF}Fortune \n{FFFFFF}Freeway \n{FFFFFF}Glendale \n{FFFFFF}Greenwood ");
strcat(vehicles, "\n{FFFFFF}Hermes \n{FFFFFF}Hotdog \n{FFFFFF}Hotknife \n{FFFFFF}Hotring Racer \n{FFFFFF}Hotring Racer A \n{FFFFFF}Hotring Racer B \n{FFFFFF}HPV-1000 \n{FFFFFF}Hunter \n{FFFFFF}Huntley \n{FFFFFF}Hustler \n{FFFFFF}Hydra \n{FFFFFF}Infernus ");
strcat(vehicles, "\n{FFFFFF}Intruder \n{FFFFFF}Jester \n{FFFFFF}Jetmax \n{FFFFFF}Journey \n{FFFFFF}Kart \n{FFFFFF}Landstalker \n{FFFFFF}Launch \n{FFFFFF}Leviathan \n{FFFFFF}Linerunner \n{FFFFFF}Majestic \n{FFFFFF}Manana \n{FFFFFF}Marquis ");
strcat(vehicles, "\n{FFFFFF}Maverick \n{FFFFFF}Merit \n{FFFFFF}Mesa \n{FFFFFF}Monster \n{FFFFFF}Monster A \n{FFFFFF}Monster B \n{FFFFFF}Moonbeam \n{FFFFFF}Mower \n{FFFFFF}Mr. Whoopee \n{FFFFFF}Mule \n{FFFFFF}Nebula \n{FFFFFF}Nevada ");
strcat(vehicles, "\n{FFFFFF}Newsvan \n{FFFFFF}NRG-500 \n{FFFFFF}Oceanic \n{FFFFFF}Packer \n{FFFFFF}Patriot \n{FFFFFF}PCJ-600 \n{FFFFFF}Perennial \n{FFFFFF}Phoenix \n{FFFFFF}Picador \n{FFFFFF}Pizzaboy \n{FFFFFF}Police Car (LSPD) ");
strcat(vehicles, "\n{FFFFFF}Police Car (LVPD)\n{FFFFFF}Police Car (SFPD) \n{FFFFFF}Police Maverick \n{FFFFFF}Police Ranger ");
strcat(vehicles, "\n{FFFFFF}Pony \n{FFFFFF}Perdator \n{FFFFFF}Premier \n{FFFFFF}Previon \n{FFFFFF}Primo \n{FFFFFF}Quadbike \n{FFFFFF}Raindance \n{FFFFFF}Rancher \n{FFFFFF}Reefer \n{FFFFFF}Regina ");
ShowPlayerDialog(playerid, DIALOG_SHOPVEHICLES,DIALOG_STYLE_LIST, "{FFFFFF}Game Shop" , vehicles, "Select", "Close");
"{FFFFFF}"
new vehicles[2240]; strcat(vehicles, "{FFFFFF}Admiral\n{FFFFFF}Alpha\n{FFFFFF}Ambulance\n{FFFFFF}Baggage\n{FFFFFF}Bandito\n{FFFFFF}Banshee\n{FFFFFF}Barracks\n{FFFFFF}Beagle\n{FFFFFF}Benson\n{FFFFFF}BF-400"); strcat(vehicles, "\n{FFFFFF}BF Injection\n{FFFFFF}Bike\n{FFFFFF}Blade\n{FFFFFF}Blista Compact\n{FFFFFF}Bloodring Banger\n{FFFFFF}BMX\n{FFFFFF}Bobcat\n{FFFFFF}Boxville\n{FFFFFF}Bravura"); strcat(vehicles, "\n{FFFFFF}Broadway\n{FFFFFF}Buccaneer\n{FFFFFF}Buffalo\n{FFFFFF}Bullet\n{FFFFFF}Burrito\n{FFFFFF}Bus\n{FFFFFF}Cabbie\n{FFFFFF}Caddy\n{FFFFFF}Cadrona\n{FFFFFF}Camper"); strcat(vehicles, "\n{FFFFFF}Cargobob\n{FFFFFF}Cement Truck\n{FFFFFF}Cheetah\n{FFFFFF}Clover\n{FFFFFF}Club\n{FFFFFF}Coach\n{FFFFFF}Coastguard\n{FFFFFF}Combine Harvester\n{FFFFFF}Comet"); strcat(vehicles, "\n{FFFFFF}Cropduster\n{FFFFFF}DFT-30\n{FFFFFF}Dinghy\n{FFFFFF}Dodo\n{FFFFFF}Dozer\n{FFFFFF}Dumper\n{FFFFFF}Dune\n{FFFFFF}Elegant\n{FFFFFF}Elegy\n{FFFFFF}Emperor"); strcat(vehicles, "\n{FFFFFF}Enforcer\n{FFFFFF}Esperanto\n{FFFFFF}Euros\n{FFFFFF}Faggio\n{FFFFFF}FBI Rancher\n{FFFFFF}FBI Truck\n{FFFFFF}FCR-900\n{FFFFFF}Feltzer\n{FFFFFF}Firetruck"); strcat(vehicles, "\n{FFFFFF}Flash\n{FFFFFF}Flatbed\n{FFFFFF}Forklift\n{FFFFFF}Fortune\n{FFFFFF}Freeway\n{FFFFFF}Glendale\n{FFFFFF}Greenwood\n{FFFFFF}Hermes\n{FFFFFF}Hotdog"); strcat(vehicles, "\n{FFFFFF}Hotknife\n{FFFFFF}Hotring Racer\n{FFFFFF}Hotring Racer A\n{FFFFFF}Hotring Racer B\n{FFFFFF}HPV-1000\n{FFFFFF}Hunter\n{FFFFFF}Huntley\n{FFFFFF}Hustler"); strcat(vehicles, "\n{FFFFFF}Hydra\n{FFFFFF}Infernus\n{FFFFFF}Intruder\n{FFFFFF}Jester\n{FFFFFF}Jetmax\n{FFFFFF}Journey\n{FFFFFF}Kart\n{FFFFFF}Landstalker\n{FFFFFF}Launch"); strcat(vehicles, "\n{FFFFFF}Leviathan\n{FFFFFF}Linerunner\n{FFFFFF}Majestic\n{FFFFFF}Manana\n{FFFFFF}Marquis\n{FFFFFF}Maverick\n{FFFFFF}Merit\n{FFFFFF}Mesa\n{FFFFFF}Monster"); strcat(vehicles, "\n{FFFFFF}Monster A\n{FFFFFF}Monster B\n{FFFFFF}Moonbeam\n{FFFFFF}Mower\n{FFFFFF}Mr. Whoopee\n{FFFFFF}Mule\n{FFFFFF}Nebula\n{FFFFFF}Nevada\n{FFFFFF}Newsvan"); strcat(vehicles, "\n{FFFFFF}NRG-500\n{FFFFFF}Oceanic\n{FFFFFF}Packer\n{FFFFFF}Patriot\n{FFFFFF}PCJ-600\n{FFFFFF}Perennial\n{FFFFFF}Phoenix\n{FFFFFF}Picador\n{FFFFFF}Pizzaboy"); strcat(vehicles, "\n{FFFFFF}Police Car (LSPD)\n{FFFFFF}Police Car (LVPD)\n{FFFFFF}Police Car (SFPD)\n{FFFFFF}Police Maverick\n{FFFFFF}Police Ranger\n{FFFFFF}Pony\n{FFFFFF}Perdator"); strcat(vehicles, "\n{FFFFFF}Premier\n{FFFFFF}Previon\n{FFFFFF}Primo\n{FFFFFF}Quadbike\n{FFFFFF}Raindance\n{FFFFFF}Rancher\n{FFFFFF}Reefer\n{FFFFFF}Regina"); ShowPlayerDialog(playerid, DIALOG_SHOPVEHICLES, DIALOG_STYLE_LIST, "{FFFFFF}Game Shop", vehicles, "Select", "Close");
You're missusing the {FFFFFF} that's the first thing, you should add it like this
PHP код:
|
This work, i'm just aligning and fixing the spaces & padding
Код:
new vehicles[2240]; strcat(vehicles, "{FFFFFF}Admiral\n{FFFFFF}Alpha\n{FFFFFF}Ambulance\n{FFFFFF}Baggage\n{FFFFFF}Bandito\n{FFFFFF}Banshee\n{FFFFFF}Barracks\n{FFFFFF}Beagle\n{FFFFFF}Benson\n{FFFFFF}BF-400"); strcat(vehicles, "\n{FFFFFF}BF Injection\n{FFFFFF}Bike\n{FFFFFF}Blade\n{FFFFFF}Blista Compact\n{FFFFFF}Bloodring Banger\n{FFFFFF}BMX\n{FFFFFF}Bobcat\n{FFFFFF}Boxville\n{FFFFFF}Bravura"); strcat(vehicles, "\n{FFFFFF}Broadway\n{FFFFFF}Buccaneer\n{FFFFFF}Buffalo\n{FFFFFF}Bullet\n{FFFFFF}Burrito\n{FFFFFF}Bus\n{FFFFFF}Cabbie\n{FFFFFF}Caddy\n{FFFFFF}Cadrona\n{FFFFFF}Camper"); strcat(vehicles, "\n{FFFFFF}Cargobob\n{FFFFFF}Cement Truck\n{FFFFFF}Cheetah\n{FFFFFF}Clover\n{FFFFFF}Club\n{FFFFFF}Coach\n{FFFFFF}Coastguard\n{FFFFFF}Combine Harvester\n{FFFFFF}Comet"); strcat(vehicles, "\n{FFFFFF}Cropduster\n{FFFFFF}DFT-30\n{FFFFFF}Dinghy\n{FFFFFF}Dodo\n{FFFFFF}Dozer\n{FFFFFF}Dumper\n{FFFFFF}Dune\n{FFFFFF}Elegant\n{FFFFFF}Elegy\n{FFFFFF}Emperor"); strcat(vehicles, "\n{FFFFFF}Enforcer\n{FFFFFF}Esperanto\n{FFFFFF}Euros\n{FFFFFF}Faggio\n{FFFFFF}FBI Rancher\n{FFFFFF}FBI Truck\n{FFFFFF}FCR-900\n{FFFFFF}Feltzer\n{FFFFFF}Firetruck"); strcat(vehicles, "\n{FFFFFF}Flash\n{FFFFFF}Flatbed\n{FFFFFF}Forklift\n{FFFFFF}Fortune\n{FFFFFF}Freeway\n{FFFFFF}Glendale\n{FFFFFF}Greenwood\n{FFFFFF}Hermes\n{FFFFFF}Hotdog"); strcat(vehicles, "\n{FFFFFF}Hotknife\n{FFFFFF}Hotring Racer\n{FFFFFF}Hotring Racer A\n{FFFFFF}Hotring Racer B\n{FFFFFF}HPV-1000\n{FFFFFF}Hunter\n{FFFFFF}Huntley\n{FFFFFF}Hustler"); strcat(vehicles, "\n{FFFFFF}Hydra\n{FFFFFF}Infernus\n{FFFFFF}Intruder\n{FFFFFF}Jester\n{FFFFFF}Jetmax\n{FFFFFF}Journey\n{FFFFFF}Kart\n{FFFFFF}Landstalker\n{FFFFFF}Launch"); strcat(vehicles, "\n{FFFFFF}Leviathan\n{FFFFFF}Linerunner\n{FFFFFF}Majestic\n{FFFFFF}Manana\n{FFFFFF}Marquis\n{FFFFFF}Maverick\n{FFFFFF}Merit\n{FFFFFF}Mesa\n{FFFFFF}Monster"); strcat(vehicles, "\n{FFFFFF}Monster A\n{FFFFFF}Monster B\n{FFFFFF}Moonbeam\n{FFFFFF}Mower\n{FFFFFF}Mr. Whoopee\n{FFFFFF}Mule\n{FFFFFF}Nebula\n{FFFFFF}Nevada\n{FFFFFF}Newsvan"); strcat(vehicles, "\n{FFFFFF}NRG-500\n{FFFFFF}Oceanic\n{FFFFFF}Packer\n{FFFFFF}Patriot\n{FFFFFF}PCJ-600\n{FFFFFF}Perennial\n{FFFFFF}Phoenix\n{FFFFFF}Picador\n{FFFFFF}Pizzaboy"); strcat(vehicles, "\n{FFFFFF}Police Car (LSPD)\n{FFFFFF}Police Car (LVPD)\n{FFFFFF}Police Car (SFPD)\n{FFFFFF}Police Maverick\n{FFFFFF}Police Ranger\n{FFFFFF}Pony\n{FFFFFF}Perdator"); strcat(vehicles, "\n{FFFFFF}Premier\n{FFFFFF}Previon\n{FFFFFF}Primo\n{FFFFFF}Quadbike\n{FFFFFF}Raindance\n{FFFFFF}Rancher\n{FFFFFF}Reefer\n{FFFFFF}Regina"); ShowPlayerDialog(playerid, DIALOG_SHOPVEHICLES, DIALOG_STYLE_LIST, "{FFFFFF}Game Shop", vehicles, "Select", "Close"); |
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 3484 bytes
Code size: 94008 bytes
Data size: 293408 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 407284 bytes
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 248 bytes
Code size: 1160 bytes
Data size: 20916 bytes
Stack/heap size: 16384 bytes; estimated max. usage=5326 cells (21304 bytes)
Total requirements: 38708 bytes
It's to anticipate the whole string size. I recompiled with the exact number, which is 5300 roughly.
Oh, also I have forgotten to mention, I tried pasting everything in a .txt file, however \n s aren't take into account by the script... |
https://sampwiki.blast.hk/wiki/Limits - Max String length inside a dialog, 4096 Characters.
|
I guess much pages would help you.. Make a page that displays some cars, and when he clicks the button "next" show him a new dialog with new cars, etc..
|
static vehicles[1080];
strcat(vehicles, "Admiral\nAlpha\nAmbulance\nBaggage\nBandito\nBanshee\nBarracks\nBeagle\nBenson\nBF-400");
strcat(vehicles, "\nBF Injection\nBike\nBlade\nBlista Compact\nBloodring Banger\nBMX\nBobcat\nBoxville\nBravura");
strcat(vehicles, "\nBroadway\nBuccaneer\nBuffalo\nBullet\nBurrito\nBus\nCabbie\nCaddy\nCadrona\nCamper");
strcat(vehicles, "\nCargobob\nCement Truck\nCheetah\nClover\nClub\nCoach\nCoastguard\nCombine Harvester\nComet");
strcat(vehicles, "\nCropduster\nDFT-30\nDinghy\nDodo\nDozer\nDumper\nDune\nElegant\nElegy\nEmperor");
strcat(vehicles, "\nEnforcer\nEsperanto\nEuros\nFaggio\nFBI Rancher\nFBI Truck\nFCR-900\nFeltzer\nFiretruck");
strcat(vehicles, "\nFlash\nFlatbed\nForklift\nFortune\nFreeway\nGlendale\nGreenwood\nHermes\nHotdog");
strcat(vehicles, "\nHotknife\nHotring Racer\nHotring Racer A\nHotring Racer B\nHPV-1000\nHunter\nHuntley\nHustler");
strcat(vehicles, "\nHydra\nInfernus\nIntruder\nJester\nJetmax\nJourney\nKart\nLandstalker\nLaunch");
strcat(vehicles, "\nLeviathan\nLinerunner\nMajestic\nManana\nMarquis\nMaverick\nMerit\nMesa\nMonster");
strcat(vehicles, "\nMonster A\nMonster B\nMoonbeam\nMower\nMr. Whoopee\nMule\nNebula\nNevada\nNewsvan");
strcat(vehicles, "\nNRG-500\nOceanic\nPacker\nPatriot\nPCJ-600\nPerennial\nPhoenix\nPicador\nPizzaboy");
strcat(vehicles, "\nPolice Car (LSPD)\nPolice Car (LVPD)\nPolice Car (SFPD)\nPolice Maverick\nPolice Ranger\nPony\nPerdator");
strcat(vehicles, "\nPremier\nPrevion\nPrimo\nQuadbike\nRaindance\nRancher\nReefer\nRegina");
ShowPlayerDialog(playerid, DIALOG_SHOPVEHICLES, DIALOG_STYLE_LIST, "Game Shop", vehicles, "Select", "Close");
No need of using 9000 as as strlen is only 1080 after removing {FFFFFF} which was useless as its white by default.
PHP код:
|