Frage | Fraktion Car Tuning

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
  • Aloha,


    Ich habe mal durch server geschaut uns sah das die Gangs & Staats Fraks die Fraktionsautos tunen könn.


    Und jetz kam ich auf die idee wie man sowas für GF "dini" schreibt.


    Was können sie tunen?


    Alles außer Farbe verändern


    Jeffry bester man!


    EDIT: Das es auch gespeichert wird!

  • Beitrag von Jeffry ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • Jeffry


    public SaveFactionCars(bool:destroy){
    if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE);
    new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024];
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n",
    FactionCars[fc][fVehid],
    FactionCars[fc][fPos][0],
    FactionCars[fc][fPos][1],
    FactionCars[fc][fPos][2],
    FactionCars[fc][fPos][3],
    FactionCars[fc][fCol][0],
    FactionCars[fc][fCol][1],
    FactionCars[fc][fFaction][0],
    FactionCars[fc][fFaction][1],
    FactionCars[fc][fFaction][2],
    FactionCars[fc][fFaction][3],
    FactionCars[fc][fFaction][4],
    FactionCars[fc][fTuning][0],
    FactionCars[fc][fTuning][1],
    FactionCars[fc][fTuning][2],
    FactionCars[fc][fTuning][3],
    FactionCars[fc][fTuning][4],
    FactionCars[fc][fTuning][5],
    FactionCars[fc][fTuning][6],
    FactionCars[fc][fTuning][7],
    FactionCars[fc][fTuning][8],
    FactionCars[fc][fTuning][9],
    FactionCars[fc][fTuning][10],
    FactionCars[fc][fTuning][11],
    FactionCars[fc][fTuning][12],
    FactionCars[fc][fTuning][13],
    FactionCars[fc][fPrice]);
    fwrite(fFile,Content);
    if(destroy == true){
    if(DestroyVehicle(FactionCars[fc][fCarid]))
    FactionCars[fc][fCarid] = -255;
    }
    }
    }fclose(fFile);
    return true;
    }

    Einmal editiert, zuletzt von DerFamer ()

  • Versuche es so:
    public SaveFactionCars(bool:destroy)
    {
    if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE);
    new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024];
    for(new fc;fc<sizeof(FactionCars);fc++)
    {
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    {
    for(new i=0; i<13; i++) FactionCars[fc][fTuning][i] = GetVehicleComponentInSlot(FactionCars[fc][fCarid], i);
    format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n",
    FactionCars[fc][fVehid],
    FactionCars[fc][fPos][0],
    FactionCars[fc][fPos][1],
    FactionCars[fc][fPos][2],
    FactionCars[fc][fPos][3],
    FactionCars[fc][fCol][0],
    FactionCars[fc][fCol][1],
    FactionCars[fc][fFaction][0],
    FactionCars[fc][fFaction][1],
    FactionCars[fc][fFaction][2],
    FactionCars[fc][fFaction][3],
    FactionCars[fc][fFaction][4],
    FactionCars[fc][fTuning][0],
    FactionCars[fc][fTuning][1],
    FactionCars[fc][fTuning][2],
    FactionCars[fc][fTuning][3],
    FactionCars[fc][fTuning][4],
    FactionCars[fc][fTuning][5],
    FactionCars[fc][fTuning][6],
    FactionCars[fc][fTuning][7],
    FactionCars[fc][fTuning][8],
    FactionCars[fc][fTuning][9],
    FactionCars[fc][fTuning][10],
    FactionCars[fc][fTuning][11],
    FactionCars[fc][fTuning][12],
    FactionCars[fc][fTuning][13],
    FactionCars[fc][fPrice]);
    fwrite(fFile,Content);
    if(destroy == true)
    {
    if(DestroyVehicle(FactionCars[fc][fCarid]))
    FactionCars[fc][fCarid] = -255;
    }
    }
    }
    fclose(fFile);
    return true;
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • public SaveFactionCars(bool:destroy){
    if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE);
    new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024];
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n",
    FactionCars[fc][fVehid],
    FactionCars[fc][fPos][0],
    FactionCars[fc][fPos][1],
    FactionCars[fc][fPos][2],
    FactionCars[fc][fPos][3],
    FactionCars[fc][fCol][0],
    FactionCars[fc][fCol][1],
    FactionCars[fc][fFaction][0],
    FactionCars[fc][fFaction][1],
    FactionCars[fc][fFaction][2],
    FactionCars[fc][fFaction][3],
    FactionCars[fc][fFaction][4],
    FactionCars[fc][fTuning][0],
    FactionCars[fc][fTuning][1],
    FactionCars[fc][fTuning][2],
    FactionCars[fc][fTuning][3],
    FactionCars[fc][fTuning][4],
    FactionCars[fc][fTuning][5],
    FactionCars[fc][fTuning][6],
    FactionCars[fc][fTuning][7],
    FactionCars[fc][fTuning][8],
    FactionCars[fc][fTuning][9],
    FactionCars[fc][fTuning][10],
    FactionCars[fc][fTuning][11],
    FactionCars[fc][fTuning][12],
    FactionCars[fc][fTuning][13],
    FactionCars[fc][fPrice]);
    fwrite(fFile,Content);
    if(destroy == true){
    if(DestroyVehicle(FactionCars[fc][fCarid]))
    FactionCars[fc][fCarid] = -255;
    }
    }
    }fclose(fFile);
    return true;
    }

  • Debugge es so und poste dann was im Server Log steht, wenn du die Funktion aufrufst:
    public SaveFactionCars(bool:destroy)
    {
    printf("SaveFactionCars aufgerufen.");
    if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE);
    new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024];
    for(new fc;fc<sizeof(FactionCars);fc++)
    {
    printf("fc: %d | fVehid: %d", fc, FactionCars[fc][fVehid]);
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    {
    for(new i=0; i<13; i++) FactionCars[fc][fTuning][i] = GetVehicleComponentInSlot(FactionCars[fc][fCarid], i);
    format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n",
    FactionCars[fc][fVehid],
    FactionCars[fc][fPos][0],
    FactionCars[fc][fPos][1],
    FactionCars[fc][fPos][2],
    FactionCars[fc][fPos][3],
    FactionCars[fc][fCol][0],
    FactionCars[fc][fCol][1],
    FactionCars[fc][fFaction][0],
    FactionCars[fc][fFaction][1],
    FactionCars[fc][fFaction][2],
    FactionCars[fc][fFaction][3],
    FactionCars[fc][fFaction][4],
    FactionCars[fc][fTuning][0],
    FactionCars[fc][fTuning][1],
    FactionCars[fc][fTuning][2],
    FactionCars[fc][fTuning][3],
    FactionCars[fc][fTuning][4],
    FactionCars[fc][fTuning][5],
    FactionCars[fc][fTuning][6],
    FactionCars[fc][fTuning][7],
    FactionCars[fc][fTuning][8],
    FactionCars[fc][fTuning][9],
    FactionCars[fc][fTuning][10],
    FactionCars[fc][fTuning][11],
    FactionCars[fc][fTuning][12],
    FactionCars[fc][fTuning][13],
    FactionCars[fc][fPrice]);
    printf("Content: %s", Content);
    fwrite(fFile,Content);
    if(destroy == true)
    {
    if(DestroyVehicle(FactionCars[fc][fCarid]))
    FactionCars[fc][fCarid] = -255;
    }
    }
    }
    printf("Ende.");
    fclose(fFile);
    return true;
    }

  • SA-MP Dedicated Server
    ----------------------
    v0.3.7, (C)2005-2015 SA-MP Team


    [17:49:35] filterscripts = "" (string)
    [17:49:35]
    [17:49:35] Server Plugins
    [17:49:35] --------------
    [17:49:35] Loading plugin: streamer
    [17:49:35]


    *** Streamer Plugin v2.5.2 by Incognito loaded ***


    [17:49:35] Loaded.
    [17:49:35] Loading plugin: audio
    [17:49:35] Failed.
    [17:49:35] Loaded 1 plugins.


    [17:49:35]
    [17:49:35] Filterscripts
    [17:49:35] ---------------
    [17:49:35] Loaded 0 filterscripts.


    [17:49:36] '0' Fraktionsfahrzeuge wurden geladen & erstellt.
    [17:49:36] BizzInfo:0 Owner:The State Message:GhostGunshop Entfee:150 Till:300 Products:498/500 Interior:6.


    [17:49:36] BizzInfo:1 Owner:The State Message:Mr_Ghost Gunshop Entfee:2 Till:2908 Products:409/500 Interior:7.


    [17:49:36] BizzInfo:2 Owner:The State Message:Restaurant zum Mönchen Entfee:500 Till:3350 Products:320/500 Interior:1.


    [17:49:36] BizzInfo:3 Owner:The State Message:Yakuza Gunshop Entfee:50 Till:1450 Products:487/500 Interior:6.


    [17:49:36] BizzInfo:4 Owner:The State Message:Obi Baumarkt Entfee:500 Till:0 Products:99654/100000 Interior:4.


    [17:49:36] SBizzInfo:0 Owner:Zu Verkaufen Message:Jack´s Carren Entfee:500 Till:10 Products:99999/100 Interior:0.


    [17:49:36] SBizzInfo:1 Owner:Zu Verkaufen Message:WANG CARS Entfee:0 Till:430 Products:100/100 Interior:0.


    [17:49:36] SBizzInfo:2 Owner:Enduron Message:Endurons Biz Entfee:5 Till:5005 Products:100/100 Interior:0.


    [17:49:36] SBizzInfo:3 Owner:The State Message:~w~Gas Company Entfee:1 Till:1257113 Products:100/100 Interior:0.


    [17:49:36] SBizzInfo:4 Owner:Philipp. Message:Olli's Strom - Company Entfee:300 Till:0 Products:100/100 Interior:0.


    [17:49:36] SBizzInfo:5 Owner:TheBreaker Message:~w~Car Delivery Entfee:0 Till:122900 Products:74/100 Interior:0.


    [17:49:36] SBizzInfo:6 Owner:Zu Verkaufen Message:Papas House Upgrade Biz Entfee:0 Till:25809 Products:95/100 Interior:0.


    [17:49:36] SBizzInfo:7 Owner:Zu Verkaufen Message:Papas House Upgrade Biz Entfee:0 Till:25809 Products:95/100 Interior:0.


    [17:49:36] SBizzInfo:8 Owner:Zu Verkaufen Message:]]]San Andreas News]]] Entfee:2 Till:196 Products:93/100 Interior:0.


    [17:49:36] [connection] 127.0.0.1:63306 requests connection cookie.
    [17:49:36] GangZone 0 loadad: 1677.387939,-2164.481933,1870.788208,-2007.005126,1858.253662,-2096.573974,13.546899,5
    [17:49:36] GangZone 1 loadad: 630.636413,-1587.785766,779.336669,-1401.087890,723.152221,-1482.819702,1.968799,6
    [17:49:36] GangZone 2 loadad: 2524.522460,2196.688720,2664.685791,2450.328613,2587.406982,2309.241699,17.822200,13
    [17:49:36] GangZone 3 loadad: 0.000000,2196.688720,2664.685791,2450.328613,2587.406982,2309.241699,17.822200,13
    [17:49:36] GangZone 4 loadad: 0.000000,2196.688720,2664.685791,2450.328613,2587.406982,2309.241699,17.822200,13
    [17:49:36] GangZone 5 loadad: 0.000000,2196.688720,2664.685791,2450.328613,2587.406982,2309.241699,17.822200,13
    [17:49:36] GangZone 6 loadad: 0.000000,2196.688720,2664.685791,2450.328613,2587.406982,2309.241699,17.822200,13
    [17:49:36] AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
    [17:49:36] Pickups Max = 2048, Current Pickups = 436
    [17:49:36]
    [17:49:36]
    [17:49:36]
    [17:49:36] _______________________________________
    [17:49:36] Alle System wurden Hochgefahren.
    [17:49:36] Userfiles wurden erkannt und geladen.
    [17:49:36] Bussystem wurde Gestartet.(Falls vorhanden)
    [17:49:36] Dieses Script wurde von Anthony Editiert.
    [17:49:36] Das Verbreiten ist Illegal und wird mit einer
    [17:49:36] Anzeige bestraft.
    [17:49:36] Mit freundlichen Grüßen, Anthony
    [17:49:36] _______________________________________
    [17:49:36]
    [17:49:36]
    [17:49:36]
    [17:49:36] Number of vehicle models: 97
    [17:49:37] Incoming connection: 127.0.0.1:63306 id: 0
    [17:49:37] [npc:join] Bus_LS has joined the server (0:127.0.0.1)

  • Dann hast du SaveFactionCars nicht aufgerufen. Der erste Print muss mindestens erscheinen.
    Außerdem, wenn deine Datei leer ist, dann wird logischerweise nichts geladen. Du musst die Fahrzeuge erst erstellen und speichern, bevor du sie laden kannst.