Problem mit Warnings [Bekomme sie nicht weg!

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
  • C:\Windows\Vss\First Person\German Life-v2.5-0.3x\German Life - v2.5 0.3x\gamemodes\ZSP.pwn(49858) : warning 202: number of arguments does not match definition
    C:\Windows\Vss\First Person\German Life-v2.5-0.3x\German Life - v2.5 0.3x\gamemodes\ZSP.pwn(53811) : warning 202: number of arguments does not match definition



    if (strcmp("/opark", cmd, true, 10) == 0)
    {
    if(IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 525 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    if(PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
    {
    if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
    {
    SendClientMessage(playerid, COLOR_GREY, " An deinem Abschleppwagen ist kein Auto angehängt!");
    return 1;
    }
    new trailercar = GetVehicleTrailer(GetPlayerVehicleID(playerid));
    if(!IsADtCar(trailercar))
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieses Auto kann hier nicht geparkt werden!!");
    return 1;
    }
    new id = GetPlayerVehicleID(playerid);
    DetachTrailerFromVehicle(id);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z);
    SetVehiclePos(trailercar, 9999.0, -9999.0, -200.0);
    new Carowner = GetDtCarOwner(trailercar);
    new slot = GetDtCarOwnerSlot(Carowner,trailercar);
    printf("Abgeschleppt: %d slot %d", Carowner, slot);
    PlayerCar[Carowner][slot][CarPos_x] = 9999.0;
    PlayerCar[Carowner][slot][CarPos_y] = -9999.0;
    PlayerCar[Carowner][slot][CarPos_z] = -200.0;
    PlayerCar[Carowner][slot][CarRotate] = 0.0;
    PlayerCar[Carowner][slot][Abgeschleppt] = 1; //Nicht vergessen im enum hinzuzufügen!
    if(Carowner != 555)
    {
    OnPlayerCarUpdate(Carowner,false); //Zeile 49858
    }
    SendClientMessage(playerid, COLOR_YELLOW, " Du hast das Fahrzeug erfolgreich abgeschleppt!");
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Mitglied des Ordnungsamtes!");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du musst einen Abschleppwagen fahren!");
    return 1;
    }
    }


    if(dialogid == DIALOG_FREIKAUFEN)
    {
    static place;
    new slot = Dtc_PlayerKey[playerid];
    switch(place)
    {
    case 0:
    {
    SetVehiclePos(PlayerCar[playerid][slot][CarId], 2249.3130,2007.7671,10.5253);
    PlayerCar[playerid][slot][CarPos_x] = 2249.0;
    PlayerCar[playerid][slot][CarPos_y] = 3130.0;
    PlayerCar[playerid][slot][CarPos_z] = 2007.0;
    PlayerCar[playerid][slot][CarRotate] = 0.0;
    place = 1;
    }
    case 1:
    {
    SetVehiclePos(PlayerCar[playerid][slot][CarId], 2245.0942,2007.8237,10.5254);
    PlayerCar[playerid][slot][CarPos_x] = 2245.0;
    PlayerCar[playerid][slot][CarPos_y] = 0942.0;
    PlayerCar[playerid][slot][CarPos_z] = 2007.0;
    PlayerCar[playerid][slot][CarRotate] = 0.0;
    place = 2;
    }
    case 2:
    {
    SetVehiclePos(PlayerCar[playerid][slot][CarId], 2241.0894,2007.8383,10.5254);
    PlayerCar[playerid][slot][CarPos_x] = 2241.0;
    PlayerCar[playerid][slot][CarPos_y] = 0894.0;
    PlayerCar[playerid][slot][CarPos_z] = 2007.0;
    PlayerCar[playerid][slot][CarRotate] = 0.0;
    place = 0;
    }
    }
    PlayerCar[playerid][slot][Abgeschleppt] = 0;
    OnPlayerCarUpdate(playerid,false); //Zeile 53811
    return SendClientMessage(playerid, 0xFFFFFFFF, "Freigekauft.");
    }

  • Function OnPlayerCarUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    for(new x = 0; x < MaxVeh; x++)
    {
    if(Dtc_PlayerHaveCar[playerid][x])
    {
    DestroyVehicle(PlayerCar[playerid][x][CarId]);
    Dtc_Carlock[PlayerCar[playerid][x][CarId]] = 0;
    Dtc_LockCar(PlayerCar[playerid][x][CarId]);
    new string3[128];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Autos/%s%d.dtcar", playername3,x);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=%d\n",PlayerCar[playerid][x][CarId]);fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",PlayerCar[playerid][x][CarModel]);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][x][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][x][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][x][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][x][CarRotate]);fwrite(hFile, var);
    format(var, 32, "CarNitro=%d\n",PlayerCar[playerid][x][CarNitro]);fwrite(hFile, var);
    format(var, 32, "CarHyd=%d\n",PlayerCar[playerid][x][CarHyd]);fwrite(hFile, var);
    format(var, 32, "CarWheel=%d\n",PlayerCar[playerid][x][CarWheel]);fwrite(hFile, var);
    format(var, 32, "CarAusp=%d\n",PlayerCar[playerid][x][CarAusp]);fwrite(hFile, var);
    format(var, 32, "CarSideL=%d\n",PlayerCar[playerid][x][CarSideL]);fwrite(hFile, var);
    format(var, 32, "CarSideR=%d\n",PlayerCar[playerid][x][CarSideR]);fwrite(hFile, var);
    format(var, 32, "CarFB=%d\n",PlayerCar[playerid][x][CarFB]);fwrite(hFile, var);
    format(var, 32, "CarRB=%d\n",PlayerCar[playerid][x][CarRB]);fwrite(hFile, var);
    format(var, 32, "CarSpoiler=%d\n",PlayerCar[playerid][x][CarSpoiler]);fwrite(hFile, var);
    format(var, 32, "CarRoof=%d\n",PlayerCar[playerid][x][CarRoof]);fwrite(hFile, var);
    format(var, 32, "CarHood=%d\n",PlayerCar[playerid][x][CarHood]);fwrite(hFile, var);
    format(var, 32, "CarVents=%d\n",PlayerCar[playerid][x][CarVents]);fwrite(hFile, var);
    format(var, 32, "CarLamps=%d\n",PlayerCar[playerid][x][CarLamps]);fwrite(hFile, var);
    format(var, 32, "CarPJ=%d\n",PlayerCar[playerid][x][CarPJ]);fwrite(hFile, var);
    format(var, 32, "CarC1=%d\n",PlayerCar[playerid][x][CarC1]);fwrite(hFile, var);
    format(var, 32, "CarC2=%d\n",PlayerCar[playerid][x][CarC2]);fwrite(hFile, var);
    format(var, 32, "Plate=%s\n",PlayerCar[playerid][x][Plate]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }
    }
    }

  • C:\Windows\Vss\First Person\German Life-v2.5-0.3x\German Life - v2.5 0.3x\gamemodes\GNE.pwn(53299) : warning 225: unreachable code
    if(listitem == 5)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(GetPlayerInterior(playerid) != 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " * Du bist in einem Interior, dort hast du keinen Empfang, geh auf die Straße.");
    return 1;
    }
    if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Cop!");
    {
    SendClientMessage(playerid, COLOR_GREY, " * Es ist kein Polizist im Dienst, bitte versuche es später noch einmal");
    return 1;
    }
    new sendername[MAX_PLAYER_NAME]; //Zeile 53299
    new string[256];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[Leitstelle] %s hat einen Streifenwagen angefordert, Gib (/accept polizei) ein um den Auftrag anzunehmen.", sendername);
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
    {
    SendClientMessage(i, COLOR_LIGHTBLUE, string);
    }
    }
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE, " * Du hast einen Streifenwafen gerufen, warte auf eine Antwort.");
    SetTimerEx("ServiceReset", 30000, false, "i", playerid);
    JustService[playerid] = 1;
    CopCall = playerid;
    return 1;
    }
    }
    }


    }


  • Du hast bei Zeile 53295 eine Klammer geöffnet aber keine Abfrage vorher gemacht, dort gehört wenn ich das richtig sehe die Abfrage wie viele Cops OnDuty sind hin.
    Das könnte den Warning verursachen.

    05eb03de-9fda-461c-9dfc-834ae5b64e65.png << Server | Home >> 13462590508.png

  • if(listitem == 5)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(GetPlayerInterior(playerid) != 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " * Du bist in einem Interior, dort hast du keinen Empfang, geh auf die Straße.");
    return 1;
    }
    if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Cop!");
    {
    SendClientMessage(playerid, COLOR_GREY, " * Es ist kein Polizist im Dienst, bitte versuche es später noch einmal");
    return 1;
    new sendername[MAX_PLAYER_NAME]; //Zeile 53299
    new string[256];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[Leitstelle] %s hat einen Streifenwagen angefordert, Gib (/accept polizei) ein um den Auftrag anzunehmen.", sendername);
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
    {
    SendClientMessage(i, COLOR_LIGHTBLUE, string);
    }
    }
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE, " * Du hast einen Streifenwafen gerufen, warte auf eine Antwort.");
    SetTimerEx("ServiceReset", 30000, false, "i", playerid);
    JustService[playerid] = 1;
    CopCall = playerid;
    return 1;
    }
    }
    }


    }


    So?


    //E:


    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 mood;mood<14;mood++)
    FactionCars[fc][fTuning][mood] = 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;
    }


    Wen ich jetz /efa 560 6 6 16 mache kommt Falsche Fraktion nur ID 16 ist Vagos was ist da Falsch?

    Einmal editiert, zuletzt von DerFamer ()

  • 1)
    if(listitem == 5)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(GetPlayerInterior(playerid) != 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " * Du bist in einem Interior, dort hast du keinen Empfang, geh auf die Straße.");
    return 1;
    }
    if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Cop!");
    {
    SendClientMessage(playerid, COLOR_GREY, " * Es ist kein Polizist im Dienst, bitte versuche es später noch einmal");
    return 1;
    }
    new sendername[MAX_PLAYER_NAME]; //Zeile 53299
    new string[256];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[Leitstelle] %s hat einen Streifenwagen angefordert, Gib (/accept polizei) ein um den Auftrag anzunehmen.", sendername);
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
    {
    SendClientMessage(i, COLOR_LIGHTBLUE, string);
    }
    }
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE, " * Du hast einen Streifenwafen gerufen, warte auf eine Antwort.");
    SetTimerEx("ServiceReset", 30000, false, "i", playerid);
    JustService[playerid] = 1;
    CopCall = playerid;
    return 1;
    }
    }


    2)
    Versuche es so:
    dcmd_efa(playerid,params[])
    {
    if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL)
    {
    new vehid,col1,col2,faction[5];
    if(!sscanf(params,"ddddD(0)D(0)D(0)",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 mood;mood<14;mood++)
    FactionCars[fc][fTuning][mood] = 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;
    }