Suche Car Spawner [ZCMD]

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
  • Hallo,
    ich suche einen Car Spawner, über ZCMD.
    Das ich ZB: /v turismo eingebe und dann kommt die Karre ^^
    Hoffe jemand kann mir da helfen. :D


    //EDIT Gelöst:


    Ganz Oben:
    new PlayerHasCreated[MAX_VEHICLES];


    Initialisierung:
    public OnGameModeInit()
    {
    for(new i = 1; i < MAX_VEHICLES; i++)
    {
    PlayerHasCreated[i] = -1; // -1 stellt einen ungültigen Spieler dar
    }
    }


    Zum Erstellen der Fahrzeuge:
    COMMAND:spawn(playerid,params[])
    {
    new spawncar;
    if(sscanf(params, "d", spawncar))
    {
    return SendClientMessage(playerid,rot,"Tippe: /spawn [ID]");
    }


    if(spawncar < 400 || spawncar > 611)
    {
    return SendClientMessage(playerid,gelb,"Nur Fahrzeug-ID's von 400-611 benutzen!");
    }


    else
    {
    new Float:x, Float:y, Float:z, Float:a;
    new string[256];
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid,a);
    new vehicleid = CreateVehicle(spawncar, x+5, y, z+3, a+90, 0, 0, -1);
    PlayerHasCreated[vehicleid] = playerid;


    format(string, sizeof(string), "Du hast ein Fahrzeug mit der ID %d gespawnt.", spawncar);
    SendClientMessage(playerid, blau, string);
    }
    return 1;
    }


    Zum Löschen der Gespawnten Fahrzeuge:
    COMMAND:delspawn(playerid,params[])
    {
    for(new i = 1; i < MAX_VEHICLES; i++)
    {
    if(PlayerHasCreated[i] == playerid)
    if(IsVehicleUnused(i))
    {
    DestroyVehicle(i);
    PlayerHasCreated[i] = -1;
    }
    }
    SendClientMessage(playerid,blau,"Du hast alle gespawnten Fahrzeuge gelöscht!");
    return 1;
    }


    Zusätzlich noch Fahrzeug IDs von beliebten Fahrzeugen (nicht alle) :
    COMMAND:f(playerid,params[])
    {
    SendClientMessage(playerid,blau,"=============================================== {FFFF00}Fahrzeuge mit IDs{0000FF} ===============================================");
    SendClientMessage(playerid,blau2,"Dumper [406] - Infernus [411] - BF Injection [424] - Hunter [425] - Panzer [432] - Squallo [446] - Seasparrow [447] - Tram [449] - Turismo [451]");
    SendClientMessage(playerid,blau2,"Monster [556] - Faggio [462] - Sanchez [468] - Sparrow [469] - Patriot [470] - Quad [471] - Schlauchboot [473] - Rustler [476] - Maverick [487]");
    SendClientMessage(playerid,blau2,"FBI Rancher [490] - Jetmax [493] - Hotring [494] - Sandking [495] - P. Maverick [497] - Hydra [520] - NRG [522] - Tow Truck [525] - Vortex [539]");
    SendClientMessage(playerid,blau2,"Cargobob [548] - Uranus [558] - Jester [559] - Sultan [560] - Raindance [563] - Flash [565] - Bandito [568] - Kart [571] - Dune [573]");
    SendClientMessage(playerid,blau2,"Club [589] - Dodo [593] - LSPD [596] - P. Ranger [599]");
    SendClientMessage(playerid,blau,"=============================================================================================================");
    return 1;
    }

    MfG SkrilLinux


    Ich habe euch erfolgreich geholfen?
    -Dann wäre es nett wenn ihr 1x auf Bedanken klickt :)

    Einmal editiert, zuletzt von Freestyyler ()

  • Hey :)
    Die Namen habe ich glaube ich schon ^^
    new FahrzeugName[][] =
    {
    "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", "Police Car",
    "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
    "Phoenix", "2. Gebrauchtwagen", "1. Gebrauchtwagen", "Luggage", "Luggage", "Stairs", "Boxville",
    "Tiller", "Utility Trailer"
    };

    MfG SkrilLinux


    Ich habe euch erfolgreich geholfen?
    -Dann wäre es nett wenn ihr 1x auf Bedanken klickt :)

  • Hier, das ist nicht meins, aber aus Filterscript ;)



    if(strcmp(cmd, "/v", true, 10) == 0)
    {
    if(IsPlayerAdmin(playerid))
    {
    new String[200];
    new tmp[256];
    new Float:x, Float:y, Float:z;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Tippe: {FFD200}/v {FFFFFF}[NAME] (z.B {FFD200}/v elegy)");
    new vehicle = GetVehicleModelIDFromName(tmp);
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, COLOR_YELLOW, "{FFFFFF}ERROR:{FFD200} Dieses Auto existiert nicht!");
    new Float:a;
    GetPlayerFacingAngle(playerid, a);
    GetPlayerPos(playerid, x, y, z);
    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
    GetXYInFrontOfPlayer(playerid, x, y, 8);
    }
    else
    {
    GetXYInFrontOfPlayer(playerid, x, y, 5);
    }
    new Float:X,Float:Y,Float:Z, Float:Angle,int1;
    GetPlayerPos(playerid, X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    if(PlayerVehicle[playerid] != 0) { DestroyVehicle(PlayerVehicle[playerid]); }
    PlayerVehicle[playerid] = CreateVehicle(vehicle, x, y, z, a+1, -1, -1, -1);
    LinkVehicleToInterior(PlayerVehicle[playerid],int1);
    PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 0);
    format(String, sizeof(String), "{FFFFFF}Du hast ein {FFD200}%s {FFFFFF}Gespawnt.", aVehicleNames[vehicle - 400]);
    SendClientMessage(playerid,COLOR_YELLOW, String);
    return 1;
    }
    return 1;
    }



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


    stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
    {
    new Float:a;


    GetPlayerPos(playerid, x2, y2, a);
    GetPlayerFacingAngle(playerid, a);


    if(GetPlayerVehicleID(playerid))
    {
    GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }


    x2 += (distance * floatsin(-a, degrees));
    y2 += (distance * floatcos(-a, degrees));
    }

  • Statt "Turismo" würde ich aber dann doch lieber die Modellid empfehlen und schreibst du dich noch dumm und dusselig beim Definieren der Fahrzeuge :D


    Statt "Turismo" würde ich aber dann doch lieber die Modellid empfehlen und schreibst du dich noch dumm und dusselig beim Definieren der Fahrzeuge :D



    hey :)
    ist das ein ZCMD?

    MfG SkrilLinux


    Ich habe euch erfolgreich geholfen?
    -Dann wäre es nett wenn ihr 1x auf Bedanken klickt :)


  • //GANZ OBEN
    new PlayerVehicle[MAX_PLAYERS];
    /////


    COMMAND:v(playerid,params[])
    {
    if(IsPlayerAdmin(playerid)) //Kannst auch deine Adminabfrage
    {
    new String[200], Float:x, Float:y, Float:z, Float:a, vname[20], vehicle = GetVehicleModelIDFromName(vname);
    if(sscanf(params,"s",vname)) return SendClientMessage(playerid, 0xFEFEFEFE, "Tippe: {FFD200}/v {FFFFFF}[NAME] (z.B {FFD200}/v elegy)");
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, 0xFEFEFEFE, "{FFFFFF}ERROR:{FFD200} Dieses Auto existiert nicht!");
    GetPlayerFacingAngle(playerid, a);
    GetPlayerPos(playerid, x, y, z);
    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
    GetXYInFrontOfPlayer(playerid, x, y, 8);
    }
    else
    {
    GetXYInFrontOfPlayer(playerid, x, y, 5);
    }
    new Float:X,Float:Y,Float:Z, Float:Angle,int1;
    GetPlayerPos(playerid, X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    if(PlayerVehicle[playerid] != 0) { DestroyVehicle(PlayerVehicle[playerid]); }
    PlayerVehicle[playerid] = CreateVehicle(vehicle, x, y, z, a+1, -1, -1, -1);
    LinkVehicleToInterior(PlayerVehicle[playerid],int1);
    PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 0);
    format(String, sizeof(String), "{FFFFFF}Du hast ein {FFD200}%s {FFFFFF}Gespawnt.", FahrzeugName[vehicle - 400]);
    SendClientMessage(playerid,0xFEFEFEFE, String);
    return 1;
    }
    return 1;
    }


    stock GetVehicleModelIDFromName(vname[])
    {
    for(new i = 0; i < 211; i++)
    {
    if(strfind(FahrzeugName[i], vname, true) != -1)
    return i + 400;
    }
    return -1;
    }
    stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
    {
    new Float:a;
    GetPlayerPos(playerid, x2, y2, a);
    GetPlayerFacingAngle(playerid, a);
    if(GetPlayerVehicleID(playerid))
    {
    GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x2 += (distance * floatsin(-a, degrees));
    y2 += (distance * floatcos(-a, degrees));
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • vehicle = GetVehicleModelIDFromName(vname);


    vllt zu


    vehicle = GetVehicleModelIDFromName(FahrzeugName[vehicle - 400]);


    Wo soll ich das hinschreiben?
    So?
    new String[200], Float:x, Float:y, Float:z, Float:a, vname[20], vehicle = GetVehicleModelIDFromName(FahrzeugName[vehicle - 400]);
    if(sscanf(params,"s",vname)) return SendClientMessage(playerid, 0xFEFEFEFE, "Tippe: {FFD200}/v {FFFFFF}[NAME] (z.B {FFD200}/v elegy)");
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, 0xFEFEFEFE, "{FFFFFF}ERROR:{FFD200} Dieses Auto existiert nicht!");
    GetPlayerFacingAngle(playerid, a);
    GetPlayerPos(playerid, x, y, z);
    if(IsPlayerInAnyVehicle(playerid) == 1)

    MfG SkrilLinux


    Ich habe euch erfolgreich geholfen?
    -Dann wäre es nett wenn ihr 1x auf Bedanken klickt :)

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen