Need help with /engine
#1

Hello yet again, I need some help with /engine... Here are all the vehicle names that I've got:

pawn Код:
new VehicleNames[212][] = {
   "Landstalker",  "Bravura",  "Buffalo", "Linerunner", "Perennial", "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",  "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 Truck",  "Nevada", "Yosemite", "Windsor",  "Monster",
   "Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RCTiger",
   "Flash","Tahoma","Savanna", "Bandito", "Freight", "Trailer", "Kart", "Mower",
   "Dune", "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",
   "Police Car (LSPD)", "Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
   "Picador",   "S.W.A.T. Van",  "Alpha",   "Phoenix",   "Glendale",   "Sadler",
   "Luggage Trailer","Luggage Trailer","Stair Trailer", "Boxville", "Farm Plow",
   "Utility Trailer"
};

GetVehicleModelIDFromName(vname[])
{
    for(new i = 0; i < 211; i++)
    {
        if(strfind(VehicleNames[i], vname, true) != -1)
        return i + 400;
    }
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new playername[MAX_PLAYER_NAME];
    new cmd[256];
    new tmp[256];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);

    if (strcmp("/engine", cmdtext, true, 10) == 0)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new vehiclename = GetVehicleModelIDFromName(vname[]);
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(IsPlayerInAnyVehicle(playerid))
            {
                if(GetPlayerVehicleSeat(playerid) == 0)
                {
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    if(engine == 1)
                    {
                        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
                        format(string, sizeof(string), "%s stops the engine of the %s.", sendername,vehiclename);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                    else
                    SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
                    format(string, sizeof(string), "%s starts the engine of the %s.", sendername,vehiclename);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else SendClientMessage(playerid, COLOR_ERROR, "Error: You are not driving the vehicle.");
                return 1;
            }
            else
            SendClientMessage(playerid, COLOR_ERROR, "Error: You are not in a vehicle.");
    }
}
When I come to compile it, the error comes up as:

Quote:

: error 017: undefined symbol "vname"

And that line is:

pawn Код:
new vehiclename = GetVehicleModelIDFromName(vname[]);
I'd appreciate any help, and I'll give a + reputation to the person who can help solve this problem.
Reply


Messages In This Thread
Need help with /engine ** REP OFFERED TO FIXER ** - by DanishHaq - 23.07.2013, 11:56
Re: Need help with /engine - by DanishHaq - 23.07.2013, 12:27
Re: Need help with /engine - by NaClchemistryK - 23.07.2013, 12:40
Re: Need help with /engine - by DanishHaq - 23.07.2013, 12:42
Re: Need help with /engine - by RajatPawar - 23.07.2013, 12:43
Re: Need help with /engine - by DanishHaq - 23.07.2013, 14:24

Forum Jump:


Users browsing this thread: 1 Guest(s)