Create Vehicle [HILFE]

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
  • HAT SICH ERLEDIGT
    [s]
    Hey Leute,
    habe ein filterscript von Vincent bekommen und nun wollte ich es so einstellen, das das nur admins machen können.
    kann mir jemand helfen?
    Danke








    #include
    #include
    #include


    #define VEHICLES_PER_PLAYER 4
    // Dialoge
    #define VEHICLE_LIST_DIALOG 1231


    public OnFilterScriptInit()
    {
    print("Vehiclespawner by Vincent Petritz");
    return 1;
    }


    stock GetPlayerNameEx(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
    }


    main()
    {
    print("Vehiclespawner by Vincent Petritz");
    }


    ocmd:carlist(playerid, params[])
    {
    #pragma unused params
    new str1[100],
    str2[70],
    str3[500];
    format(str1, sizeof(str1), "[%d/%d] Vehicles von dir, %s.", GetPVarInt(playerid, "VehiclesOwned"), VEHICLES_PER_PLAYER, GetPlayerNameEx(playerid));
    if(GetPVarInt(playerid, "VehiclesOwned") == 0)
    {
    format(str2, sizeof(str2), "Fahrzeug mit /createcar hinzufügen");
    ShowPlayerDialog(playerid, VEHICLE_LIST_DIALOG, DIALOG_STYLE_LIST, str1, str2, "Ok", "");
    }
    else if(GetPVarInt(playerid, "VehiclesOwned") >= 1) {
    format(str3, sizeof(str3), "CarID Farben\n%d %d & %d\n%d %d & %d\n%d %d & %d\n%d %d & %d\n%d %d & %d",
    GetPVarInt(playerid, "VehicleID1"),
    GetPVarInt(playerid, "VehicleCOL11"),
    GetPVarInt(playerid, "VehicleCOL21"),
    GetPVarInt(playerid, "VehicleID2"),
    GetPVarInt(playerid, "VehicleCOL12"),
    GetPVarInt(playerid, "VehicleCOL22"),
    GetPVarInt(playerid, "VehicleID3"),
    GetPVarInt(playerid, "VehicleCOL13"),
    GetPVarInt(playerid, "VehicleCOL23"),
    GetPVarInt(playerid, "VehicleID4"),
    GetPVarInt(playerid, "VehicleCOL14"),
    GetPVarInt(playerid, "VehicleCOL24"));
    ShowPlayerDialog(playerid, VEHICLE_LIST_DIALOG, DIALOG_STYLE_LIST, str1, str3, "Ok", "");
    }
    return 1;
    }


    ocmd:createcar(playerid, params[])
    {
    new carID, colID1, colID2, slot;
    if(sscanf(params, "dddd", carID, colID1, colID2, slot))
    return SendClientMessage(playerid, 0xFF0023FF, "Falsche Eingabe: /createcar [carID] [colID] [colID] [slotID]");
    if(GetPVarInt(playerid, "VehiclesOwned") <= 4)
    {
    new str[100];
    format(str, sizeof(str), "VehicleID%d", slot);
    if(GetPVarInt(playerid, str) == 0 && slot < 5)
    {
    new str1[128],
    Float:x,
    Float:y,
    Float:z,
    vehicleForPlayer,
    str5[128],
    str2[50],
    str3[50],
    str4[50];
    GetPlayerPos(playerid, x, y, z);
    format(str1, sizeof(str1), "[VehicleSpawner] Vehicle auf Slot %d gespawned.", slot);
    format(str5, sizeof(str5), "[VehicleSpawner] Slot: %d; CarID: %d; Col1: %d; Col2: %d", slot, carID, colID1, colID2);
    vehicleForPlayer = CreateVehicle(carID, x, y, z, 0, colID1, colID2, 60);
    PutPlayerInVehicle(playerid, vehicleForPlayer, 0);
    format(str2, sizeof(str2), "VehicleCOL1%d", slot);
    format(str3, sizeof(str3), "VehicleCOL2%d", slot);
    format(str4, sizeof(str4), "VehicleIDx%d", slot);
    SetPVarInt(playerid, str4, GetPlayerVehicleID(playerid));
    SetPVarInt(playerid, str2, colID1);
    SetPVarInt(playerid, str3, colID2);
    SetPVarInt(playerid, str, carID);
    SetPVarInt(playerid, "VehiclesOwned", GetPVarInt(playerid, "VehiclesOwned") +1);
    SendClientMessage(playerid, 0xFF8C00FF, str1);
    SendClientMessage(playerid, 0xFF8C00FF, str5);
    }
    else
    return SendClientMessage(playerid, 0xFF0023FF, "Fahrzeug auf Slot vorhanden!");
    }
    else
    return SendClientMessage(playerid, 0xFF0023FF, "Maximale Slotanzahl verbraucht!");
    return 1;
    }


    ocmd:destroycar(playerid, params[])
    {
    new slot;
    if(sscanf(params, "d", slot))
    return SendClientMessage(playerid, 0xFF0023FF, "Falsche Eingabe: /destroycar [Slot]");
    if(slot > 0 && slot < 5)
    {
    new str1[100],
    str2[50],
    str3[50],
    str4[50],
    str5[50];
    format(str1, sizeof(str1), "[VehicleSpawner] Carslot %d ist nun wieder frei!", slot);
    SendClientMessage(playerid, 0xFF8C00FF, str1);
    format(str2, sizeof(str2), "VehicleCOL1%d", slot);
    format(str3, sizeof(str3), "VehicleCOL2%d", slot);
    format(str4, sizeof(str4), "VehicleIDx%d", slot);
    format(str5, sizeof(str5), "VehicleID%d", slot);
    DestroyVehicle(GetPVarInt(playerid, str4));
    SetPVarInt(playerid, str2, 0);
    SetPVarInt(playerid, str3, 0);
    SetPVarInt(playerid, str4, 0);
    SetPVarInt(playerid, str5, 0);
    }
    else
    return SendClientMessage(playerid,0xFF0023FF, "Falsche Slotangabe!");
    return 1;
    }</a_samp>[/s]

    Scripter im Ruhestand.

    Einmal editiert, zuletzt von Scripter4.0 ()