Frage zu "/v [ID/Name]"

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hab ich mich auch immer gefragt, vor paar Jahren konnt ich das auch nicht selbst scripten, vor 2 Jahren oder so hab ich den dann "mal eben" selbst gebaut ^^



    new VehNames[][] = //Nicht von mir ^^
    {
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
    "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
    "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "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", "Boxvillde", "Benson", "Mesa", "RC Goblin",
    "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
    "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "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", "Monster", "Uranus", "Jester", "Sultan", "Stratum",
    "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
    "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
    "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
    "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "CopCarLS",
    "CopCarSF", "CopCarLV", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
    "Phoenix", "2. Gebrauchtwagen", "1. Gebrauchtwagen", "Luggage", "Luggage", "Stairs", "Boxville",
    "Tiller", "Utility Trailer"
    };



    GetVehicleIDByName(EnteredName[])
    {
    for(new v = 0; v < sizeof(VehNames); v++)
    {
    if(strfind(VehNames[v],EnteredName,true) != -1)
    {
    return v+400;
    }
    }
    if(strval(EnteredName) > 0) return strval(EnteredName);
    return -1;
    }


    //CMD
    if (strcmp("/veh", cmdtext, true,4) == 0)
    {
    if(strlen(cmdtext) <= 4) return 1;
    new Float:x, Float:y, Float:z;
    new vehicleID = GetVehicleIDByName(cmdtext[5]);
    if(vehicleID == -1) return 1;
    GetPlayerPos(playerid, x, y, z);
    PutPlayerInVehicle(playerid, CreateVehicle(vehicleID,x,y,z+1.0,0.0,1,1,-1), 0);
    return 1;
    }

    Kann man sicher noch ausbauen, aber für mich zum "mal eben" nen Fahrzeug spawnen tut er es. Übrigends gehen auch Teile des Namens, also "NRG" geht auch.

  • xdd :D Kann man vor CreateVehicle ein VehCar = CreateVehicle und DestroyVehicle = VehCar ? Ginge das


    Fals es jemand braucht mit löschen ich hatte gerade bisschen langeweile :D


    oben im Script


    new VehCars;
    /veh

    if (strcmp("/veh", cmdtext, true,4) == 0)
    {
    if(SpielerInfo[playerid][Adminlevel] >= 2)
    {
    if(strlen(cmdtext) <= 4) return 1;
    new Float:x, Float:y, Float:z;
    new vehicleID = GetVehicleIDByName(cmdtext[5]);
    if(vehicleID == -1) return 1;
    GetPlayerPos(playerid, x, y, z);
    PutPlayerInVehicle(playerid, VehCars = CreateVehicle(vehicleID,x,y,z+1.0,0.0,1,1,-1), 0);
    }
    else
    {
    SCM(playerid,Rot,"Administratoren Command Error : Du darfst diesen Befehl nicht benutzen");
    }
    return 1;
    }
    /delveh

    if (strcmp("/delveh", cmdtext, true) == 0)
    {
    if(SpielerInfo[playerid][Adminlevel] >= 2)
    {
    DestroyVehicle(VehCars);
    SCM(playerid,Weiss,"{fff63}Admin Vehicle System : {fefefe}Du hast das Fahrzueg gelöscht");
    }
    else
    {
    SCM(playerid,Rot,"Administratoren Command Error : Du darfst diesen Befehl nicht benutzen");
    }
    return 1;
    }

    Mit freundlichen Grüßen,
    Dachdecker

    Einmal editiert, zuletzt von Dachdecker ()