Behoben Dank Jeffry! /Closed!

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
  • Hay Sorry das ich schon wider ein Thema erstelle!


    Undzwar hab ich ein bug!


    Ich erstelle das Auto mit /efa und parke das Auto und dann mache ich restart und dann ist das Auto weg?


    [18:45:24] '1' Fraktionsfahrzeuge wurden geladen & erstellt.


    public LoadFactionCars(){
    if(!fexist(FACTION_CAR_FILE)){
    new File:tfFile=fopen(FACTION_CAR_FILE,io_write);
    fclose(tfFile);
    }
    new File:fFile=fopen(FACTION_CAR_FILE,io_read),Content[1024],fc;
    while(fread(fFile,Content) && fc<sizeof(FactionCars)){
    sscanf(Content,"dffffdddddddddddddddddddddd",
    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]);
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    #if defined FACTION_CARS_LOCKABLE
    fLockCar(FactionCars[fc][fCarid]);
    FactionCars[fc][fLock] = true;
    #endif
    #if defined FACTION_CARS_TUNEABLE
    if(IsAllowedFactionToTune(FactionCars[fc][fFaction][0])){
    if(FactionCars[fc][fTuning][0] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][0]); }
    if(FactionCars[fc][fTuning][1] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][1]); }
    if(FactionCars[fc][fTuning][2] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][2]); }
    if(FactionCars[fc][fTuning][3] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][3]); }
    if(FactionCars[fc][fTuning][4] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][4]); }
    if(FactionCars[fc][fTuning][5] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][5]); }
    if(FactionCars[fc][fTuning][6] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][6]); }
    if(FactionCars[fc][fTuning][7] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][7]); }
    if(FactionCars[fc][fTuning][8] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][8]); }
    if(FactionCars[fc][fTuning][9] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][9]); }
    if(FactionCars[fc][fTuning][10] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][10]); }
    if(FactionCars[fc][fTuning][11] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][11]); }
    if(FactionCars[fc][fTuning][12] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][12]); }
    if(FactionCars[fc][fTuning][13] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][13]); }
    }
    #endif
    fc++;
    }
    }fclose(fFile);
    return printf(" '%d' Fraktionsfahrzeuge wurden geladen & erstellt.",fc);
    }


    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;
    }


    dcmd_efa(playerid,params[]){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
    new vehid,col1,col2,faction[5];
    if(!sscanf(params,"dddd",vehid,col1,col2,faction[0])){
    sscanf(params,"dddddddd",vehid,col1,col2,faction[0],faction[1],faction[2],faction[3],faction[4]);
    if(vehid < 400 || vehid > 611) return SendClientMessage(playerid,FACTION_COL_GREY,"Vehicle-ID nur von 400 bis 611.");
    if(col1 < 0 || col1 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(1)!");
    if(col2 < 0 || col2 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(2)!");
    if(faction[0] && faction[0] <= MAX_FACTIONS){
    for(new f;f<5;f++){
    if(faction[f] <= 0 || faction[f] > MAX_FACTIONS){
    faction[f] = -255;
    }
    }
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] < 400 || FactionCars[fc][fVehid] > 611){
    FactionCars[fc][fVehid] = vehid;
    new Float:fX,Float:fY,Float:fZ,Float:fA;
    GetPlayerPos(playerid,fX,fY,fZ),GetPlayerFacingAngle(playerid,fA);
    FactionCars[fc][fPos][0] = fX;
    FactionCars[fc][fPos][1] = fY;
    FactionCars[fc][fPos][2] = fZ;
    FactionCars[fc][fPos][3] = fA;
    FactionCars[fc][fCol][0] = col1;
    FactionCars[fc][fCol][1] = col2;
    for(new f;f<5;f++){
    FactionCars[fc][fFaction][f] = faction[f];
    }
    FactionCars[fc][fPrice] = 0;
    for(new mod;mod<14;mod++)
    FactionCars[fc][fTuning][mod] = 0;
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    #if defined FACTION_CARS_LOCKABLE
    FactionCars[fc][fLock] = true;
    #endif
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug erfolgreich erstellt.");
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Vergesse es nicht mit '/fpark' umzuparken.");
    PutPlayerInVehicle(playerid,FactionCars[fc][fCarid],0);
    return true;
    }
    }SendClientMessage(playerid,FACTION_COL_GREY,"Die Maximale Anzahl von Fraktionsfahrzeugen wurde bereits erreicht.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Fraktion!");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Benutze: '/efa [Model] [Farbe(1)] [Farbe(2)] [Hauptfraktion]'.");
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }


    //E:


    Server Log

    Einmal editiert, zuletzt von DerFamer ()

  • Lass dir die Koordinaten mal ausgeben, dann weißt du wo das Fahrzeug steht.
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    zu:
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    printf("Fahrzeug %d (Idx: %d) steht: %f / %f / %f", FactionCars[fc][fCarid], fc, FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2]);

  • Schein jetz zu Funktioniren.


    Ich Werde es gleich testen zu tunen wen es nicht da ist liegt es an Tuning.


    //E:



    Das hätte ich mal :)!


    Aber habe noch ein Problem das Kennzeichen wird nur geladen wen das Fahrzeug im Script ist wie kann ich das ändern das es ladet wen ich es Ingame erstelle?


    for(new pv = 0; pv < sizeof(TriadenVehs); pv++)
    {
    SetVehicleNumberPlate(TriadenVehs[pv], "TRIADEN");
    SetVehicleToRespawn(TriadenVehs[pv]);
    }

    Einmal editiert, zuletzt von DerFamer ()

  • Dann musst du beim LoadFactionCars nach:
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    das verwenden:
    SetVehicleNumberPlate(FactionCars[fc][fCarid], "TRIADEN");
    SetVehicleToRespawn(FactionCars[fc][fCarid]);


    Man könnte es auch in einer Zeile machen, aber auf Gründen der Übersichtlichkeit lass ich das hier.


    Hast du mehrere Kennzeichen, wovon ich ausgehe, musst du es mit einem switch aussuchen lassen:
    switch(FactionCars[fc][fFaction][0])
    {
    case 1: SetVehicleNumberPlate(FactionCars[fc][fCarid], "TRIADEN");
    case 2: SetVehicleNumberPlate(FactionCars[fc][fCarid], "WAS_ANDERES");
    //...
    }

  • switch(FactionCars[fc][fFaction][0])
    {
    case 1: SetVehicleNumberPlate(FactionCars[fc][fCarid], "TRIADEN");
    case 2: SetVehicleNumberPlate(FactionCars[fc][fCarid], "WAS_ANDERES");
    //...
    }


    Wo Muss ich das Angeben unter FactionCars[fc][fCarid] = CreateVehicle(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],-255);


    ?

  • Ok Danke werde ich gleich mal Testen :)!


    //E;


    Wird nicht Gespeichert :(!


    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    switch(FactionCars[fc][fFaction][0])
    {
    case 1: SetVehicleNumberPlate(FactionCars[fc][fCarid], "Regierung");
    case 2: SetVehicleNumberPlate(FactionCars[fc][fCarid], "SAPD");
    case 3: SetVehicleNumberPlate(FactionCars[fc][fCarid], "ARZT");
    case 4: SetVehicleNumberPlate(FactionCars[fc][fCarid], "FBI");
    case 5: SetVehicleNumberPlate(FactionCars[fc][fCarid], "SA Army");
    case 6: SetVehicleNumberPlate(FactionCars[fc][fCarid], "LCM");
    case 7: SetVehicleNumberPlate(FactionCars[fc][fCarid], "YAKUZA");
    case 8: SetVehicleNumberPlate(FactionCars[fc][fCarid], "XXXXXX");
    case 9: SetVehicleNumberPlate(FactionCars[fc][fCarid], "SA NEWS");
    case 10: SetVehicleNumberPlate(FactionCars[fc][fCarid], "TAXI");
    case 11: SetVehicleNumberPlate(FactionCars[fc][fCarid], "FAHRSCHULE");
    case 12: SetVehicleNumberPlate(FactionCars[fc][fCarid], "TRIADEN");
    case 13: SetVehicleNumberPlate(FactionCars[fc][fCarid], "RIFA");
    case 14: SetVehicleNumberPlate(FactionCars[fc][fCarid], "GROVE");
    case 15: SetVehicleNumberPlate(FactionCars[fc][fCarid], "BALLAS");
    case 16: SetVehicleNumberPlate(FactionCars[fc][fCarid], "VAGOS");
    case 17: SetVehicleNumberPlate(FactionCars[fc][fCarid], "AZTECAS");
    case 18: SetVehicleNumberPlate(FactionCars[fc][fCarid], "RS");
    case 19: SetVehicleNumberPlate(FactionCars[fc][fCarid], "XXXXXX");
    case 20: SetVehicleNumberPlate(FactionCars[fc][fCarid], "XXXXXX");
    case 21: SetVehicleNumberPlate(FactionCars[fc][fCarid], "Hells Angels");
    case 22: SetVehicleNumberPlate(FactionCars[fc][fCarid], "RUSSEN");
    case 23: SetVehicleNumberPlate(FactionCars[fc][fCarid], "Ordnungsamt");
    }
    SetVehicleToRespawn(FactionCars[fc][fCarid]);


    Wen ich:


    if(strcmp(cmdtext,"/rafa",true)==0){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
    new fName[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,fName,sizeof(fName));
    format(string,sizeof(string),"Server: %s hat alle Fraktionsfahrzeuge respawnt.",fName);
    SendClientMessageToAll(FACTION_COL_YELLOW,string);
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    DestroyAndCreateFactionCar(fc);
    }
    }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }


    Mache!

    Einmal editiert, zuletzt von DerFamer ()

  • Lass dir mal ausgeben für welche Fraktion das Fahrzeug ist:
    SetVehicleToRespawn(FactionCars[fc][fCarid]);
    zu:
    printf("%d gehört zu: %d", FactionCars[fc][fCarid], FactionCars[fc][fFaction][0]);
    SetVehicleToRespawn(FactionCars[fc][fCarid]);


    Was steht dann im Log?

  • [15:08:47] Fahrzeug 2 (Idx: 0) steht: 2123.104003 / 1408.514038 / 10.520000
    [15:08:47] 2 gehört zu: 12
    [15:08:47] Fahrzeug 3 (Idx: 1) steht: 2119.729003 / 1408.404052 / 10.517000
    [15:08:47] 3 gehört zu: 12
    [15:08:47] Fahrzeug 4 (Idx: 2) steht: 2116.770019 / 1408.378051 / 10.520000
    [15:08:47] 4 gehört zu: 12
    [15:08:47] '3' Fraktionsfahrzeuge wurden geladen & erstellt.


    //E:


    #define FACTION_CARS_TUNEABLE
    #if defined FACTION_CARS_LOCKABLE


    Das Funktiioniert Garnicht kommt garnix!


    #if defined FACTION_CARS_LOCKABLE
    if(strcmp(cmdtext,"/flock",true)==0){
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
    for(new fc;fc<sizeof(FactionCars);fc++){
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
    if(GetPlayerVehicleID(playerid) == FactionCars[fc][fCarid]){
    for(new f;f<5;f++){
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerFaction(playerid) == FactionCars[fc][fFaction][f]){
    PlayerPlaySound(playerid,1145,0.0,0.0,0.0);
    if(FactionCars[fc][fLock] == true){
    FactionCars[fc][fLock] = false;
    fUnlockCar(FactionCars[fc][fCarid]);
    GameTextForPlayer(playerid,"~w~Fahrzeug~n~~g~Aufgeschlossen",5000,3);
    }
    else if(FactionCars[fc][fLock] == false){
    fLockCar(FactionCars[fc][fCarid]);
    FactionCars[fc][fLock] = true;
    GameTextForPlayer(playerid,"~w~Fahrzeug~n~~r~Abgeschlossen",5000,3);
    }break;
    }
    }return true;
    }
    }
    }SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug!");
    }else{
    if(GetPlayerState(playerid)==PLAYER_STATE_PASSENGER)
    SendClientMessage(playerid,FACTION_COL_GREY,"Du musst der Fahrer dieses Fahrzeuges sein.");
    else
    SendClientMessage(playerid,FACTION_COL_GREY,"Du muss in einem Fahrzeug sitzen.");
    }return true;
    }
    #endif
    return 1;
    }

  • Hm, dann versuche es doch mal so:
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    switch(FactionCars[fc][fFaction][0])
    {
    case 1: SetVehicleNumberPlate(FactionCars[fc][fCarid], "Regierung");
    case 2: SetVehicleNumberPlate(FactionCars[fc][fCarid], "SAPD");
    case 3: SetVehicleNumberPlate(FactionCars[fc][fCarid], "ARZT");
    case 4: SetVehicleNumberPlate(FactionCars[fc][fCarid], "FBI");
    case 5: SetVehicleNumberPlate(FactionCars[fc][fCarid], "SA Army");
    case 6: SetVehicleNumberPlate(FactionCars[fc][fCarid], "LCM");
    case 7: SetVehicleNumberPlate(FactionCars[fc][fCarid], "YAKUZA");
    case 8: SetVehicleNumberPlate(FactionCars[fc][fCarid], "XXXXXX");
    case 9: SetVehicleNumberPlate(FactionCars[fc][fCarid], "SA NEWS");
    case 10: SetVehicleNumberPlate(FactionCars[fc][fCarid], "TAXI");
    case 11: SetVehicleNumberPlate(FactionCars[fc][fCarid], "FAHRSCHULE");
    case 12: SetVehicleNumberPlate(FactionCars[fc][fCarid], "TRIADEN");
    case 13: SetVehicleNumberPlate(FactionCars[fc][fCarid], "RIFA");
    case 14: SetVehicleNumberPlate(FactionCars[fc][fCarid], "GROVE");
    case 15: SetVehicleNumberPlate(FactionCars[fc][fCarid], "BALLAS");
    case 16: SetVehicleNumberPlate(FactionCars[fc][fCarid], "VAGOS");
    case 17: SetVehicleNumberPlate(FactionCars[fc][fCarid], "AZTECAS");
    case 18: SetVehicleNumberPlate(FactionCars[fc][fCarid], "RS");
    case 19: SetVehicleNumberPlate(FactionCars[fc][fCarid], "XXXXXX");
    case 20: SetVehicleNumberPlate(FactionCars[fc][fCarid], "XXXXXX");
    case 21: SetVehicleNumberPlate(FactionCars[fc][fCarid], "Hells Angels");
    case 22: SetVehicleNumberPlate(FactionCars[fc][fCarid], "RUSSEN");
    case 23: SetVehicleNumberPlate(FactionCars[fc][fCarid], "Ordnungsamt");
    }
    SetVehicleToRespawn(FactionCars[fc][fCarid]);
    zu:
    switch(FactionCars[fc][fFaction][0])
    {
    case 1: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "Regierung");
    case 2: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "SAPD");
    case 3: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "ARZT");
    case 4: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "FBI");
    case 5: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "SA Army");
    case 6: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "LCM");
    case 7: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "YAKUZA");
    case 8: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "XXXXXX");
    case 9: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "SA NEWS");
    case 10: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "TAXI");
    case 11: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "FAHRSCHULE");
    case 12: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "TRIADEN");
    case 13: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "RIFA");
    case 14: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "GROVE");
    case 15: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "BALLAS");
    case 16: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "VAGOS");
    case 17: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "AZTECAS");
    case 18: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "RS");
    case 19: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "XXXXXX");
    case 20: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "XXXXXX");
    case 21: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "Hells Angels");
    case 22: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "RUSSEN");
    case 23: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "Ordnungsamt");
    }

  • switch(FactionCars[fc][fFaction][0])
    {
    case 1: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "Regierung");
    case 2: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "SAPD");
    case 3: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "ARZT");
    case 4: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "FBI");
    case 5: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "SA Army");
    case 6: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "LCM");
    case 7: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "YAKUZA");
    case 8: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "XXXXXX");
    case 9: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "SA NEWS");
    case 10: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "TAXI");
    case 11: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "FAHRSCHULE");
    case 12: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "TRIADEN");
    case 13: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "RIFA");
    case 14: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "GROVE");
    case 15: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "BALLAS");
    case 16: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "VAGOS");
    case 17: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "AZTECAS");
    case 18: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "RS");
    case 19: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "XXXXXX");
    case 20: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "XXXXXX");
    case 21: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "Hells Angels");
    case 22: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "RUSSEN");
    case 23: SetVehicleNumberPlate((FactionCars[fc][fCarid] = CreateVehicle(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],-255)), "Ordnungsamt");
    }


    Funktioniert auch nicht :/

  • Habe ich ja da Respawnen nochmal 3 Autos sind es Ingesammt 6 Fahrzeuge.


    Respawne ich die Autos mit /rafa wie oben den Code ich schon gesendet habe ist das Nummernschild weg.


    Ich verstehe zwar nicht warum z.b wie /flock funktioniert auch nicht.

  • Dann poste bitte mal die gesamte DestroyAndCreate... Funktion.


    Zwecks dem Lock Befehl, versuche es so:
    if(strcmp(cmdtext,"/flock",true)==0)
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    for(new fc;fc<sizeof(FactionCars);fc++)
    {
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    {
    if(GetPlayerVehicleID(playerid) == FactionCars[fc][fCarid])
    {
    for(new f;f<5;f++)
    {
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerFaction(playerid) == FactionCars[fc][fFaction][f])
    {
    PlayerPlaySound(playerid,1145,0.0,0.0,0.0);
    if(FactionCars[fc][fLock] == true)
    {
    FactionCars[fc][fLock] = false;
    fUnlockCar(FactionCars[fc][fCarid]);
    GameTextForPlayer(playerid,"~w~Fahrzeug~n~~g~Aufgeschlossen",5000,3);
    }
    else if(FactionCars[fc][fLock] == false)
    {
    fLockCar(FactionCars[fc][fCarid]);
    FactionCars[fc][fLock] = true;
    GameTextForPlayer(playerid,"~w~Fahrzeug~n~~r~Abgeschlossen",5000,3);
    }
    break;
    }
    }
    return true;
    }
    }
    }
    SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug!");
    }
    else
    {
    if(GetPlayerState(playerid)==PLAYER_STATE_PASSENGER) SendClientMessage(playerid,FACTION_COL_GREY,"Du musst der Fahrer dieses Fahrzeuges sein.");
    else SendClientMessage(playerid,FACTION_COL_GREY,"Du muss in einem Fahrzeug sitzen.");
    }
    return true;
    }
    return 1;
    }

  • C:\Windows\Vss\First Person\Samp Server\gamemodes\German.pwn(66898) : error 017: undefined symbol "fLock"
    C:\Windows\Vss\First Person\Samp Server\gamemodes\German.pwn(66900) : error 017: undefined symbol "fLock"
    C:\Windows\Vss\First Person\Samp Server\gamemodes\German.pwn(66901) : error 017: undefined symbol "fUnlockCar"
    C:\Windows\Vss\First Person\Samp Server\gamemodes\German.pwn(66904) : error 017: undefined symbol "fLock"
    C:\Windows\Vss\First Person\Samp Server\gamemodes\German.pwn(66906) : error 017: undefined symbol "fLockCar"
    C:\Windows\Vss\First Person\Samp Server\gamemodes\German.pwn(66907) : error 017: undefined symbol "fLock"




    public DestroyAndCreateFactionCar(fc)
    {
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    {
    DestroyVehicle(FactionCars[fc][fCarid]);
    FactionCars[fc][fCarid] = CreateVehicle(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],-255);
    #if defined FACTION_CARS_TUNEABLE
    if(IsAllowedFactionToTune(FactionCars[fc][fFaction][0]))
    {
    for(new i=0; i<13; i++)
    {
    if(FactionCars[fc][fTuning][i] != 0)
    {
    AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][i]);
    }
    }
    }
    #endif
    }
    return true;
    }

  • Zu den Errors:
    Suche im Enum nach fLock und fUnlockCar. Entferne dort auch das
    #if defined FACTION_CARS_LOCKABLE
    und
    #else
    Oder füge direkt unter den Includes das ein:
    #define FACTION_CARS_LOCKABLE



    Zum DestroyAndCreateFactionCar:
    Der Code zum setzen des Kennzeichens ist gar nicht drin? Wo ist der hin?

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