Detecting names
#8

here you go:
pawn Код:
new
    NazwyPojazdow[212][24] =
    {
        "Landstalker",
        "Bravura",
        "Buffalo",
        "Linerunner",
        "Pereniel",
        "Sentinel",
        "Dumper",
        "Firetruck",
        "Trashmaster",
        "Stretch",
        "Manana",
        "Infernus",
        "Voodoo",
        "Pony",
        "Mule",
        "Cheetah",
        "Ambulance",
        "Leviathan",
        "Moonbeam",
        "Esperanto",
        "Taxi",
        "Washington",
        "Bobcat",
        "MrWhoopee",
        "BFInjection",
        "Hunter",
        "Premier",
        "Enforcer",
        "Securicar",
        "Banshee",
        "Predator",
        "Bus",
        "Rhino",
        "Barracks",
        "Hotknife",
        "TrailerA",
        "Previon",
        "Coach",
        "Cabbie",
        "Stallion",
        "Rumpo",
        "RCBandit",
        "Romero",
        "Packer",
        "MonsterA",
        "Admiral",
        "Squalo",
        "Seasparrow",
        "Pizzaboy",
        "Tram",
        "TrailerB",
        "Turismo",
        "Speeder",
        "Reefer",
        "Tropic",
        "Flatbed",
        "Yankee",
        "Caddy",
        "Solair",
        "BerkleysRCVan",
        "Skimmer",
        "PCJ-600",
        "Faggio",
        "Freeway",
        "RCBaron",
        "RCRaider",
        "Glendale",
        "Oceanic",
        "Sanchez",
        "Sparrow",
        "Patriot",
        "Quad",
        "Coastguard",
        "Dinghy",
        "Hermes",
        "Sabre",
        "Rustler",
        "ZR350",
        "Walton",
        "Regina",
        "Comet",
        "BMX",
        "Burrito",
        "Camper",
        "Marquis",
        "Baggage",
        "Dozer",
        "Maverick",
        "newsChopper",
        "Rancher",
        "FBIRancher",
        "Virgo",
        "Greenwood",
        "Jetmax",
        "Hotring",
        "Sandking",
        "BlistaCompact",
        "PoliceMaverick",
        "Boxville",
        "Benson",
        "Mesa",
        "RCGoblin",
        "HotringRacer",
        "HotringRacer",
        "BloodringBanger",
        "Rancher",
        "SuperGT",
        "Elegant",
        "Journey",
        "Bike",
        "MountainBike",
        "Beagle",
        "Cropdust",
        "Stunt",
        "Tanker",
        "RoadTrain",
        "Nebula",
        "Majestic",
        "Buccaneer",
        "Shamal",
        "Hydra",
        "FCR-900",
        "NRG-500",
        "HPV1000",
        "CementTruck",
        "TowTruck",
        "Fortune",
        "Cadrona",
        "FBITruck",
        "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",
        "MonsterB",
        "MonsterC",
        "Uranus",
        "Jester",
        "Sultan",
        "Stratum",
        "Elegy",
        "Raindance",
        "RCTiger",
        "Flash",
        "Tahoma",
        "Savanna",
        "Bandito",
        "Freight",
        "TrailerC",
        "Kart",
        "Mower",
        "Duneride",
        "Sweeper",
        "Broadway",
        "Tornado",
        "AT-400",
        "DFT-30",
        "Huntley",
        "Stafford",
        "BF-400",
        "newsvan",
        "Tug",
        "TrailerD",
        "Emperor",
        "Wayfarer",
        "Euros",
        "Hotdog",
        "Club",
        "TrailerE",
        "TrailerF",
        "Andromada",
        "Dodo",
        "RCCam",
        "Launch",
        "CopCatLS",
        "CopCarSF",
        "CopCarLV",
        "PoliceRanger",
        "Picador",
        "S.W.A.T.Van",
        "Alpha",
        "Phoenix",
        "Glendale",
        "Sadler",
        "LuggageTrailerA",
        "LuggageTrailerB",
        "StairTrailer",
        "Boxville",
        "FarmPlow",
        "UtilityTrailer"
    }
;
   
COMMAND:v(playerid,params[])
{

    new tmp[64];
    if(sscanf(params,"s",tmp))return SendClientMessage(playerid, 0xFFFFFFFF, "USE: /v [Vehicle Name/ID]");

    new val = 0;
   
    if(IsNumeric(tmp))
    {
        val = strval(tmp);
        goto ISNUMBER;
    }

    for(new i = 0; i < 211; i++)
    {
        if(strfind(NazwyPojazdow[i], tmp, true) != -1)
        {
            i += 400;

            ISNUMBER:

            if(val != 0)
            {
                i = val;
            }

            if(i < 400 || i > 611) return SendClientMessage(playerid, 0xFF0000FF, "* ERROR: BAD VEHICLE ID");

            /*
            if(!IsPlayerAdmin2(playerid))
            {
                if(i == 432 || i == 520 || i == 538 || i == 570 || i == 569 || i == 425)
                {
                    SendClientMessage(playerid,CWARN,"You are not allowed to spawn this vehicle!");
                    return 1;
                }
            }
            */


            new
                Float:X,
                Float:Y,
                Float:Z,
                Float:Angle,
                PlayerVeh;

            GetPlayerPos(playerid, X, Y, Z);
            GetPlayerFacingAngle(playerid, Angle);

            PlayerVeh = CreateVehicle(i, X , Y, Z + 1 , Angle, random(126), random(126), 9999999);

            LinkVehicleToInterior(PlayerVeh, GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(PlayerVeh, GetPlayerVirtualWorld(playerid));

            if(!IsPlayerInAnyVehicle(playerid)) PutPlayerInVehicle(playerid,PlayerVeh,0);

            SendClientFormatMessage(playerid, 0xFFFFFFFF, "** You have spawned a/an %s! (modelID: %d)(vehicleID: %d)", NazwyPojazdow[i - 400],i,PlayerVeh);

            return 1;
        }

        return 1;
    }

    SendClientMessage(playerid,0xFF0000FF,"Car not found!");
    return 1;
}

IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
just paste this into your script.
It's an edit but it should work.. from my gm
Reply


Messages In This Thread
Deleting vehicle on exit. - by rubygta - 23.03.2011, 15:10
Re: Detecting names - by Gamer_Z - 23.03.2011, 15:13
Re: Detecting names - by rubygta - 23.03.2011, 15:13
Re: Detecting names - by Gamer_Z - 23.03.2011, 15:14
Re: Detecting names - by rubygta - 23.03.2011, 15:15
Re: Detecting names - by rubygta - 23.03.2011, 15:24
Re: Detecting names - by xir - 23.03.2011, 15:27
Re: Detecting names - by Gamer_Z - 23.03.2011, 15:42
Re: Detecting names - by xir - 23.03.2011, 15:44
Re: Detecting names - by Gamer_Z - 23.03.2011, 15:50

Forum Jump:


Users browsing this thread: 1 Guest(s)