Sziasztok!Éppen a saját jármû lekérõ scriptemet írom, csakhogy errort dob.
Az error:
error 008: must be a constant expression; assumed zero
Ezt a sort érinti:
[pawn]new VehicleNames[] = { \"Landstalker\", {\"Bravura\"}, {\"Buffalo\"}, {\"Linerunner\"}, {\"Perennial\"}, {\"Sentinel\"}, {\"Dumper\"}, {\"Fire Truck\"}, {\"Trashmaster\"}, {\"Stretch\"},[/pawn]
Az egész script:
[pawn]
#include <a_samp>
// Author unknown. It was probably someone smart like [[user:DracoBlue|DracoBlue]] or [[user:Y_Less|Y_Less]].
stock split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc))
{
if(strsrc == delimiter || i == strlen(strsrc))
{
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
new VehicleNames[] = { \"Landstalker\", {\"Bravura\"}, {\"Buffalo\"}, {\"Linerunner\"}, {\"Perennial\"}, {\"Sentinel\"}, {\"Dumper\"}, {\"Fire Truck\"}, {\"Trashmaster\"}, {\"Stretch\"},
{\"Manana\"}, {\"Infernus\"}, {\"Voodoo\"}, {\"Pony\"}, {\"Mule\"}, {\"Cheetah\"}, {\"Ambulance\"}, {\"Leviathan\"}, {\"Moonbeam\"}, {\"Esperanto\"},
{\"Taxi\"}, {\"Washington\"}, {\"Bobcat\"}, {\"Mr. Whoopee\"}, {\"BF Injection\"}, {\"Hunter\"}, {\"Premier\"}, {\"Enforcer\"}, {\"Securicar\"}, {\"Banshee\"},
{\"Predator\"}, {\"Bus\"}, {\"Rhino\"}, {\"Barracks\"}, {\"Hotknife\"}, {\"Trailer 1\"}, {\"Previon\"}, {\"Coach\"}, {\"Cabbie\"}, {\"Stallion\"},
{\"Rumpo\"}, {\"RC Bandit\"}, {\"Romero\"}, {\"Packer\"}, {\"Monster 1\", \"Monster\"}, {\"Admiral\"}, {\"Squalo\"}, {\"Seasparrow\"}, {\"Pizzaboy\"}, {\"Tram\"},
{\"Trailer 2\"}, {\"Turismo\"}, {\"Speeder\"}, {\"Reefer\"}, {\"Tropic\"}, {\"Flatbed\"}, {\"Yankee\"}, {\"Caddy\"}, {\"Solair\"}, {\"Berkley\'s RC Van\"},
{\"Skimmer\"}, {\"PCJ-600\"}, {\"Faggio\"}, {\"Freeway\"}, {\"RC Baron\"}, {\"RC Raider\"}, {\"Glendale\"}, {\"Oceanic\"}, {\"Sanchez\"}, {\"Sparrow\"},
{\"Patriot\"}, {\"Quadbike\"}, {\"Coastguard\"}, {\"Dinghy\"}, {\"Hermes\"}, {\"Sabre\"}, {\"Rustler\"}, {\"ZR-350\"}, {\"Walton\"}, {\"Regina\"},
{\"Comet\"}, {\"BMX\"}, {\"Burrito\"}, {\"Camper\"}, {\"Marquis\"}, {\"Baggage\"}, {\"Dozer\"}, {\"Maverick\"}, {\"News Chopper\"}, {\"Rancher\"},
{\"FBI Rancher\"}, {\"Virgo\"}, {\"Greenwood\"}, {\"Jetmax\"}, {\"Hotring Racer\"}, {\"Sandking\"}, {\"Blista Compact\"}, {\"Police Maverick\"}, {\"Boxville\"}, {\"Benson\"},
{\"Mesa\"}, {\"RC Goblin\"}, {\"Hotring Racer\"}, {\"Hotring Racer 2\"}, {\"Bloodring Banger\"}, {\"Rancher Lure\"}, {\"Super GT\"}, {\"Elegant\"}, {\"Journey\"}, {\"Bike\"},
{\"Mountain Bike\"}, {\"Beagle\"}, {\"Cropduster\"}, {\"Stuntplane\"}, {\"Tanker\"}, {\"Roadtrain\"}, {\"Nebula\"}, {\"Majestic\"}, {\"Buccaneer\"}, {\"Shamal\"},
{\"Hydra\"}, {\"FCR-900\"}, {\"NRG-500\"}, {\"HPV1000\"}, {\"Cement Truck\"}, {\"Towtruck\"}, {\"Fortune\"}, {\"Cadrona\"}, {\"FBI Truck\"}, {\"Willard\"},
{\"Forklift\"}, {\"Tractor\"}, {\"Combine Harvester\"}, {\"Feltzer\"}, {\"Remington\"}, {\"Slamvan\"}, {\"Blade\"}, {\"Freight\"}, {\"Streak\"}, {\"Vortex\"},
{\"Vincent\"}, {\"Bullet\"}, {\"Clover\"}, {\"Sadler\"}, {\"Fire Truck Ladder\"}, {\"Hustler\"}, {\"Intruder\"}, {\"Primo\"}, {\"Cargobob\"}, {\"Tampa\"},
{\"Sunrise\"}, {\"Merit\"}, {\"Utility Van\"}, {\"Nevada\"}, {\"Yosemite\"}, {\"Windsor\"}, {\"Monster 2\"}, {\"Monster 3\"}, {\"Uranus\"}, {\"Jester\"},
{\"Sultan\"}, {\"Stratum\"}, {\"Elegy\"}, {\"Raindance\"}, {\"RC Tiger\"}, {\"Flash\"}, {\"Tahoma\"}, {\"Savanna\"}, {\"Bandito\"}, {\"Freight Train Flatbed\"},
{\"Streak Train Trailer\"}, {\"Kart\"}, {\"Mower\"}, {\"Dune\"}, {\"Sweeper\"}, {\"Broadway\"}, {\"Tornado\"}, {\"AT-400\"}, {\"DFT-30\"}, {\"Huntley\"},
{\"Stafford\"}, {\"BF-400\"}, {\"Newsvan\"}, {\"Tug\"}, {\"Trailer (Tanker Commando)\"}, {\"Emperor\"}, {\"Wayfarer\"}, {\"Euros\"}, {\"Hotdog\"}, {\"Club\"},
{\"Box Freight\"}, {\"Trailer 3\"}, {\"Andromada\"}, {\"Dodo\"}, {\"RC Cam\"}, {\"Launch\"}, {\"Police LS\", \"Police\"}, {\"Police SF\"}, {\"Police LV\"}, {\"Police Ranger\", \"Ranger\"},
{\"Picador\"}, {\"S.W.A.T.\"}, {\"Alpha\"}, {\"Phoenix\"}, {\"Glendale Damaged\"}, {\"Sadler\"}, {\"Baggage Trailer (covered)\"}, {\"Baggage Trailer (Uncovered)\"}, {\"Trailer (Stairs)\"}, {\"Boxville Mission\"},
{\"Farm Trailer\"} };
public OnPlayerCommandText( playerid, cmdtext[] )
{
if( strfind( cmdtext, \"/vehicle\", true ) != -1 )
{
new tmp2[2][128];
split( cmdtext, tmp, \' \' );
if( strlen( tmp2[ 1 ] ) )
{
for( new i2; i2 <= sizeof( VehicleNames ); i2++ )
{
if( i2 != 0 && strlen( VehicleNames[ i2 ] ) )
{
if( strfind( VehicleNames[ i2 ], tmp2[ 1 ] ) != -1 )
{
new Float:x, Float:y, Float:z, Float:rz;
GetPlayerPos( playerid, x, y, z );
GetPlayerFacingAngle( playerid, rz );
CreateVehicle( i2 + 400, x, y, z, rz, 0, 0, 0 );
}
}
}
}
return 1;
}
return 0;
}
[/pawn]
A kocsineveket mtaból vettem ki!