Brauche Hilfe beim /supcar befehl!

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
  • Heii :)


    Ich brauche hilfe beim /supcar Befehl ich will das wenn man ein Supcar erstell und aussteigt es verschwindet! Danke im Voraus


    Das auto heißt "supcar"



    Function OnVehicleDeath(vehicleid)
    {
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
    for(new x = 0; x < MaxVeh; x++)
    {
    if(IsPlayerConnected(playerid) && Dtc_PlayerHaveCar[playerid][x])
    {
    if (vehicleid == PlayerCar[playerid][x][CarId])
    {
    DestroyObject(suplight1[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight2[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight3[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight4[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight5[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight6[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight7[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight8[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight9[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight10[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight11[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight12[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight13[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight14[GetPlayerVehicleID(playerid)]);
    DestroyObject(light1[GetPlayerVehicleID(playerid)]);
    DestroyObject(light2[GetPlayerVehicleID(playerid)]);
    DestroyObject(light3[GetPlayerVehicleID(playerid)]);
    DestroyObject(light4[GetPlayerVehicleID(playerid)]);
    DestroyObject(light5[GetPlayerVehicleID(playerid)]);
    DestroyVehicle(PlayerCar[playerid][x][CarId]);
    PlayerCarSpawn(playerid,x);
    }
    }
    }
    }
    return 1;
    }


    if(strcmp(cmdtext, "/supcar", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pSupporter] >= 1)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new car;
    car = strval(tmp);
    new supcar = CreateVehicle(480, X,Y,Z,0.0,149,149, 60000);
    SetVehicleNumberPlate(supcar, "ADMIN");
    PutPlayerInVehicle(playerid, supcar, 0);
    AddVehicleComponent(supcar, 1010);
    AddVehicleComponent(supcar, 1087);
    CreatedCars[CreatedCar] = supcar;
    CreatedCar++;
    Gas[supcar] = GetGasMax(car);
    /*new Supcar[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(Supcar, sizeof(Supcar), "SupportMobil von %s.",sendername);
    Supportermobil=Create3DTextLabel( Supcar,0xFF8C00FF,0.0,0.0,0.0,50.0,0,4);
    Attach3DTextLabelToVehicle(Supportermobil,supcar,0.0,0.0,0.2);*/
    SendClientMessage(playerid, 0xFF8C00FF, "Du hast das Supportercar erfolgreich erstellt zum löschen /dsc oder /delsupcar!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, " Du bist nicht befugt diesen Befehl zu nutzen!");
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/dsc", true) == 0 || strcmp(cmd, "/delsupcar", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pSupporter] >= 1)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    DestroyVehicle(GetPlayerVehicleID(playerid));
    DestroyObject(suplight1[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight2[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight3[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight4[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight5[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight6[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight7[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight8[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight9[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight10[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight11[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight12[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight13[GetPlayerVehicleID(playerid)]);
    DestroyObject(suplight14[GetPlayerVehicleID(playerid)]);
    RemovePlayerFromVehicle(playerid);
    //Delete3DTextLabel(Supportermobil);
    SendClientMessage(playerid, COLOR_GREEN, "Du hast das Supportercar erfolgreich gelöscht.");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist nicht befugt den Befehl zu nutzen!");
    return 1;
    }
    }
    return 1;
    }