[Samp 0.3c] Error mit Nummernschild

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
  • also nochmal er speichert alles es geht nur wenn ich offline gehe und in den playercar log von mir gehe steht es da auch nur wenn ich wieder joine ist wieder standart und ich gucke im log da steht nigs hier erstmal mein Befehl:
    if(!strcmp(cmdtext,"/changeplate",true, 12))
    {
    for(new c = 0; c <MaxVehPerPlayer;c++)
    {
    if(Dtdc_Player[playerid][Car][code=c] != MaxVehicle +1)
    {
    new vehiclefid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 0;
    if(!cmdtext[13])return SendClientMessage(playerid,COLOR_WHITE,"Du musst mindestens eine Zahl, oder einen Buchstaben eingeben!(Z.b /changeplate XGF 113)");
    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
    new sendername[MAX_PLAYER_NAME];
    new string[9];
    new CarPlate[9];
    new result[64];
    new car = Dtdc_GetCarNearPlayer(playerid,true,10.0);
    format(string,sizeof(string),"%s",cmdtext[13]);
    SetVehicleNumberPlate(vehiclefid, string);
    SetVehicleToRespawn(vehiclefid);
    new Float: X,Float: Y,Float: Z;
    GetPlayerPos(playerid,X,Y,Z);
    SetVehiclePos(vehiclefid,X,Y,Z);
    format(Dtdc_Car[car][cSchild], 32,"%s",string);
    PutPlayerInVehicle(playerid,vehiclefid,0);
    }
    else
    {
    SendClientMessage(playerid,COLOR_WHITE,"Du musst dafür in einem Auto sitzen.");
    }
    }
    }
    return 1;
    }


    Hier wenn er es läd:


    public Dtdc_LoadVeh(FileName[])
    {
    new string[120];
    format(string,sizeof(string),"DtDynamicCars/PlayerCars/%s",FileName);
    if(fexist(string) && Dtdc_CarsNum < (MaxVehicle-1))
    {
    new File: file = fopen(string, io_read);
    if (file)
    {
    new id = Dtdc_CarsNum;
    if(id >= MaxVehicle)
    {
    for(new x=0;x<MaxVehicle;x++)
    {
    if(Dtdc_Car[x][cAktivated] == 0)
    {
    id = x;
    }
    }
    } else {
    Dtdc_CarsNum++;
    }
    new key[ 256 ] , val[ 256 ];
    new Data[ 256 ];
    new string2[200];
    while ( fread(file , Data , sizeof( Data ) ) )
    {
    key = Dtdc_GetKey( Data );
    //printf("%s - %s %s",FileName,key, Data);
    if( strcmp( key , "SlotId" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cSlotid] = strval( val ); }
    if( strcmp( key , "Owner" , true ) == 0 )
    {
    val = Dtdc_GetValue( Data );
    strmid(Dtdc_Car[id][cOwnerName], val, 0, strlen(val)-1, 255);
    format(string2,sizeof(string2),"Load: %s Owner: %s Slot: %d Key: %s Val: %s Data: %s Schild: %s",FileName,Dtdc_Car[id][cOwnerName],Dtdc_Car[id][cSlotid],key,val,Data,Dtdc_Car[id][cSchild]);
    Dtdc_Log(4,string2);
    }
    if( strcmp( key , "Preis" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cPreis] = strval( val ); }
    if( strcmp( key , "Model" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cModel] = strval( val ); }
    if( strcmp( key , "Color1" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cColor1] = strval( val ); }
    if( strcmp( key , "Color2" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cColor2] = strval( val ); }
    if( strcmp( key , "AlarmBuyed" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cAlarmBuyed] = strval( val ); }
    if( strcmp( key , "Locked" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cLocked] = strval( val ); }
    if( strcmp( key , "PJ" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cPJ] = strval( val ); }
    //Health and VehicleDmg
    if( strcmp( key , "Health" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cHealth] = floatstr( val ); }
    if( strcmp( key , "DmgPanels" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cDmgPanels] = strval( val ); }
    if( strcmp( key , "DmgDoors" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cDmgDoors] = strval( val ); }
    if( strcmp( key , "DmgLights" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cDmgLights] = strval( val ); }
    if( strcmp( key , "DmgTires" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cDmgTires] = strval( val ); }
    //Tuning
    if( strcmp( key , "Component00" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent00] = strval( val ); }
    if( strcmp( key , "Component01" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent01] = strval( val ); }
    if( strcmp( key , "Component02" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent02] = strval( val ); }
    if( strcmp( key , "Component03" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent03] = strval( val ); }
    if( strcmp( key , "Component04" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent04] = strval( val ); }
    if( strcmp( key , "Component05" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent05] = strval( val ); }
    if( strcmp( key , "Component06" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent06] = strval( val ); }
    if( strcmp( key , "Component07" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent07] = strval( val ); }
    if( strcmp( key , "Component08" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent08] = strval( val ); }
    if( strcmp( key , "Component09" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent09] = strval( val ); }
    if( strcmp( key , "Component10" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent10] = strval( val ); }
    if( strcmp( key , "Component11" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent11] = strval( val ); }
    if( strcmp( key , "Component12" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent12] = strval( val ); }
    if( strcmp( key , "Component13" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cComponent13] = strval( val ); }
    //Pos
    if( strcmp( key , "PosX" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cPosX] = floatstr( val ); }
    if( strcmp( key , "PosY" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cPosY] = floatstr( val ); }
    if( strcmp( key , "PosZ" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cPosZ] = floatstr( val ); }
    if( strcmp( key , "RotZ" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cRotZ] = floatstr( val ); }
    if( strcmp( key , "VW" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cVW] = strval( val ); }
    if( strcmp( key , "Schild" , true ) == 0 ) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cSchild] = strval( val ); }
    }
    if(Dtdc_LockOrAlarm == 1 && Dtdc_Car[id][cAlarmBuyed] == 0) { Dtdc_Car[id][cLocked] = 0; }
    Dtdc_Car[id][cAktivated] = 1;
    Dtdc_Car[id][cOwnerOnline] = MAX_PLAYERS+1;
    fclose(file);
    //printf("%s - %s %d %d",FileName,Dtdc_Car[id][cOwnerName],Dtdc_Car[id][cSlotid],Dtdc_Car[id][cModel]);
    return id;
    }
    fclose(file);

    }
    return -1;
    }


    Danke euch

    Einmal editiert, zuletzt von Bacardi® ()

  • if( strcmp( key , "Schild" , true ) == 0) { val = Dtdc_GetValue( Data ); Dtdc_Car[id][cSchild] = strval( val ); }


    Hier verpasst du cSchild eine Zahl, kein Text.
    Außerdem setzt du die Kennzeichen erneut beim Fahrzeug.

  • he und wie mache ich das jetzt?
    kannste mir das mal machen ich sehe da kein unterschied