Server schmiet ab sobald...

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


    mein Server schmiert ab sobald ich das hier einfüge:

    forward LoadFracCars();


    OnGamemodeInit:


    LoadFracCars();


    public LoadFracCars()
    {
    dini_Create("LSPDCars.ini");
    new keystring[45];
    new platestring[8];
    for(new i = 0; i < sizeof(PolizeiVehs); i++)
    {
    format(keystring,sizeof(keystring), "Car%i_Model",i);
    fCarparkInfo[1] [i] [ModelId] = dini_Int("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_X",i);
    fCarparkInfo[1] [i] [ParkX] = dini_Float("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_Y",i);
    fCarparkInfo[1] [i] [ParkY] = dini_Float("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_Z",i);
    fCarparkInfo[1] [i] [ParkZ] = dini_Float("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_Angle",i);
    fCarparkInfo[1] [i] [ParkAngle] = dini_Float("LSPDCars.ini",keystring);
    if(fCarparkInfo[1] [i] [ModelId] >= 400 && fCarparkInfo[1] [i] [ModelId] <= 611)
    {
    PolizeiVehs[i] = CreateVehicle(fCarparkInfo[1] [i] [ModelId], fCarparkInfo[1] [i] [ParkX], fCarparkInfo[1] [i] [ParkY], fCarparkInfo[1] [i] [ParkZ], fCarparkInfo[1] [i] [ParkAngle], 79, 1, 900);
    format(platestring, sizeof(platestring), "SAPD");
    SetVehicleNumberPlate(PolizeiVehs[i],platestring);
    }
    }
    return 1;
    }


    Brauche das aber alles sonst ladet es nicht usw...


    //Das was ich poste so wird es geparkt und gespeichert


    if(strcmp(cmd,"/fcarpark",true)==0 || strcmp(cmd,"/fpark",true)==0)
    {
    new vehi;
    new modelstring[45],xstring[45], ystring[45], zstring[45], anglestring[45];
    new Float:vehx, Float:vehy, Float:vehz;
    new vehmodel;
    new platestring[8];
    new Float:vehangle;
    vehi = GetPlayerVehicleID(playerid);
    GetVehicleZAngle(vehi, vehangle);
    vehmodel = GetVehicleModel(vehi);
    GetVehiclePos(vehi, vehx, vehy, vehz);
    if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
    {
    for(new i = 0; i < sizeof(PolizeiVehs); i++)
    {
    if(vehi == PolizeiVehs[i])
    {
    RemovePlayerFromVehicle(playerid);
    DestroyVehicle(PolizeiVehs[i]);
    PolizeiVehs[i] = CreateVehicle(vehmodel, vehx+0.5, vehy+0.5, vehz+0.5, vehangle, 79, 1, 900);
    format(platestring, sizeof(platestring), "SAPD");
    SetVehicleNumberPlate(PolizeiVehs[i],platestring);


    fCarparkInfo[1] [i] [ModelId] = vehmodel;
    fCarparkInfo[1] [i] [ParkX] = vehx;
    fCarparkInfo[1] [i] [ParkY] = vehy;
    fCarparkInfo[1] [i] [ParkZ] = vehz;
    fCarparkInfo[1] [i] [ParkAngle] = vehangle;


    format(modelstring,sizeof(modelstring), "Car%i_Model",i);
    dini_IntSet("LSPDCars.ini",modelstring,fCarparkInfo[1] [i] [ModelId]);


    format(xstring,sizeof(xstring), "Car%i_X",i);
    dini_FloatSet("LSPDCars.ini",xstring,fCarparkInfo[1] [i] [ParkX]);


    format(ystring,sizeof(ystring), "Car%i_Y",i);
    dini_FloatSet("LSPDCars.ini",ystring,fCarparkInfo[1] [i] [ParkY]);


    format(zstring,sizeof(zstring), "Car%i_Z",i);
    dini_FloatSet("LSPDCars.ini",zstring,fCarparkInfo[1] [i] [ParkZ]);


    format(anglestring,sizeof(anglestring), "Car%i_Angle",i);
    dini_FloatSet("LSPDCars.ini",anglestring,fCarparkInfo[1] [i] [ParkAngle]);
    }
    }
    }
    }


    Hoffe es kann einer helfen


    LG Moritz

  • Kann man das noch anders ertellen und bei OnGamemode init laden?


    public LoadFracCars()
    {
    dini_Create("LSPDCars.ini");
    new keystring[45];
    new platestring[8];
    for(new i = 0; i < sizeof(PolizeiVehs); i++)
    {
    format(keystring,sizeof(keystring), "Car%i_Model",i);
    fCarparkInfo[1] [i] [ModelId] = dini_Int("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_X",i);
    fCarparkInfo[1] [i] [ParkX] = dini_Float("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_Y",i);
    fCarparkInfo[1] [i] [ParkY] = dini_Float("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_Z",i);
    fCarparkInfo[1] [i] [ParkZ] = dini_Float("LSPDCars.ini",keystring);
    format(keystring,sizeof(keystring), "Car%i_Angle",i);
    fCarparkInfo[1] [i] [ParkAngle] = dini_Float("LSPDCars.ini",keystring);
    if(fCarparkInfo[1] [i] [ModelId] >= 400 && fCarparkInfo[1] [i] [ModelId] <= 611)
    {
    PolizeiVehs[i] = CreateVehicle(fCarparkInfo[1] [i] [ModelId], fCarparkInfo[1] [i] [ParkX], fCarparkInfo[1] [i] [ParkY], fCarparkInfo[1] [i] [ParkZ], fCarparkInfo[1] [i] [ParkAngle], 79, 1, 900);
    format(platestring, sizeof(platestring), "SAPD");
    SetVehicleNumberPlate(PolizeiVehs[i],platestring);
    }
    }
    return 1;
    }


    so nur das ganze anders

    Einmal editiert, zuletzt von SenTiZz ()