05.07.2010, 17:48
Tipo estou a fazer um fs de criar veнculos, aqui como estб:
Ai eu peguei pronto em um site, ele consulta as informaзхes la em cima no nome dos carros e manda a mensagem, ai vou mudar pra ao inves da msg criar o veiculo(dexa que com essa parte eu me viro), so quero entender porque dб os segunites erros:
Linha 312:
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#define COR_AMARELO 0xFFFF00FF
#define COR_VERDE 0x33AA33AA
new VehicleName[212][0] = {
"Landstalker",//--------> Numero 0
"Bravura",// --------> Numero 1
"Buffalo",// -------> Numero 2
"Linerunner",// -------> E assim vai...
"Pereniel",
"Sentinel",
"Dumper",
"Firetruck",
"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",
"Previon",
"Coach",
"Cabbie",
"Stallion",
"Rumpo",
"RC Bandit",
"Romero",
"Packer",
"Monster Truck",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer",
"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",
"Quad",
"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",
"Sandking",
"Blista Compact",
"Police Maverick",
"Boxville",
"Benson",
"Mesa",
"RC Goblin",
"Hotring Racer",
"Hotring Racer",
"Bloodring Banger",
"Rancher",
"Super GT",
"Elegant",
"Journey",
"Bike",
"Mountain Bike",
"Beagle",
"Cropdust",
"Stunt",
"Tanker",
"RoadTrain",
"Nebula",
"Majestic",
"Buccaneer",
"Shamal",
"Hydra",
"FCR-900",
"NRG-500",
"HPV1000",
"Cement Truck",
"Tow Truck",
"Fortune",
"Cadrona",
"FBI Truck",
"Willard",
"Forklift",
"Tractor",
"Combine",
"Feltzer",
"Remington",
"Slamvan",
"Blade",
"Freight",
"Streak",
"Vortex",
"Vincent",
"Bullet",
"Clover",
"Sadler",
"Firetruck",
"Hustler",
"Intruder",
"Primo",
"Cargobob",
"Tampa",
"Sunrise",
"Merit",
"Utility",
"Nevada",
"Yosemite",
"Windsor",
"Monster Truck",
"Monster Truck",
"Uranus",
"Jester",
"Sultan",
"Stratum",
"Elegy",
"Raindance",
"RC Tiger",
"Flash",
"Tahoma",
"Savanna",
"Bandito",
"Freight",
"Trailer",
"Kart",
"Mower",
"Duneride",
"Sweeper",
"Broadway",
"Tornado",
"AT-400",
"DFT-30",
"Huntley",
"Stafford",
"BF-400",
"Newsvan",
"Tug",
"Trailer",
"Emperor",
"Wayfarer",
"Euros",
"Hotdog",
"Club",
"Trailer",
"Trailer",
"Andromada",
"Dodo",
"RC Cam",
"Launch",
"Polнcia (LSPD)",
"Polнcia (SFPD)",
"Polнcia (LVPD)",
"Police Ranger",
"Picador",
"S.W.A.T. Van",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Trailer de Bagagens",
"Trailer de Bagagens",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Trailer de Utilidades"
};
public OnPlayerCommandText(playerid, cmdtext[])
{
/*
new Float:x;
new Float:y;
new Float:z;
new Float:a;
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
GetPlayerFacingAngle(playerid, Float:a);
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
*/
//PutPlayerInVehicle(playerid, CreateVehicle(401, x, y, z + 2.0, a, 1, 0, 10000) , 0);
if (strcmp(cmdtext, "/nomeveiculo", true)==0)
{
new string [256];
new tmp[256];
new idveiculo;
idveiculo = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_VERDE, "[ERRO DE SINTAXE] /nomeveiculo [id]");
return 1;
}
format(string, sizeof(string), "Nome do veнculo: %s.", VehicleName[idveiculo - 400]);
SendClientMessageToAll(COR_VERDE, string);
return 1;
}
return 1;
}
Код:
C:\Documents and Settings\Marxista\Meus documentos\SAMP SERVER\filterscripts\criarveiculo.pwn(312) : error 017: undefined symbol "strtok" C:\Documents and Settings\Marxista\Meus documentos\SAMP SERVER\filterscripts\criarveiculo.pwn(312) : error 033: array must be indexed (variable "tmp")
pawn Код:
tmp = strtok(cmdtext, idx);