Tankstellen Porblem

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
    ich habe ein tank system drinne jedoch kann ich nicht tanken an den posis wieso auch immer
    weil wen ich in einem car bin kommt da du bist an keiner tankstelle


    dcmd_fill(playerid,params[])
    {
    #pragma unused params
    new carid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid))
    {
    SendClientMessage(playerid,Rot,"Du musst in einem Fahrzeug sitzen!");
    return 1;
    }
    if(GetPlayerState(playerid) != 2)
    {
    SendClientMessage(playerid,Rot,"Du kannst nur als Fahrer tanken!");
    return 1;
    }
    if(IsANoTachoCar(carid))
    {
    SendClientMessage(playerid,Rot,"Dieses Fahrzeug hat keinen Tank!");
    return 1;
    }
    if(!IsPlayerInRangeOfPoint(playerid,2.0,1000.5323,-940.9221,42.1487)
    || !IsPlayerInRangeOfPoint(playerid,2.0,1007.1821,-933.7119,42.1731) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,1938.9042,-1776.3755,13.3808)
    || !IsPlayerInRangeOfPoint(playerid,2.0,1944.3123,-1769.3580,13.3820) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,1380.9349,463.2896,20.1310)
    || !IsPlayerInRangeOfPoint(playerid,2.0,1383.0538,455.8885,19.8995) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,653.2905,-569.9843,16.3285)
    || !IsPlayerInRangeOfPoint(playerid,2.0,-99.2766,-1171.7705,2.4701) //tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,-1667.5259,410.9921,7.1734)
    || !IsPlayerInRangeOfPoint(playerid,2.0,-2029.4103,158.7331,28.8301) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,-2024.0455,154.7949,28.8271)
    || !IsPlayerInRangeOfPoint(playerid,2.0,-2413.9492,970.0224,45.2878) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,-2407.4719,982.5601,45.2859)
    || !IsPlayerInRangeOfPoint(playerid,2.0,-2248.6003,-2558.2173,31.8950) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,-1605.4547,-2714.4626,48.5321)
    || !IsPlayerInRangeOfPoint(playerid,2.0,2115.1289,923.3563,10.8127) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,-1464.8555,1858.5363,32.6268)
    || !IsPlayerInRangeOfPoint(playerid,2.0,-1477.6841,1865.5970,32.6286) // tankw
    || !IsPlayerInRangeOfPoint(playerid,2.0,-1329.5178,2672.1833,50.0551)
    || !IsPlayerInRangeOfPoint(playerid,2.0,-1327.6125,2682.8066,50.0548)) // tankw
    {
    SendClientMessage(playerid,Rot,"Du bist an keiner Tankstelle!");
    return 1;
    }
    GameTextForPlayer(playerid,"~y~Bitte Warten..",3000,4);
    TogglePlayerControllable(playerid, 0);
    SetTimerEx("Tanken",10000,0,"i",playerid);
    Betanken[playerid] = 1;
    return 1;
    }


    MFG Cake

    2 Mal editiert, zuletzt von EliteCake () aus folgendem Grund: text,text

  • Die Ausrufezeichen vor der Funktion IsPlayerInRangeOfPoint wirken hier als Negation, dass heißt sie kehren die Bedingung um.
    Statt zu fragen "Wenn der Spieler in der Nähe des Punktes ist" wird daraus "Wenn der Spieler NICHT in der Nähe des Punktes ist", die if-Abfrage trifft zu, wenn die Funktion nicht true zurück gibt.


    Wenn du die Ausrufezeichen weglässt funktioniert es :)

  • Ausrufezeichen sind fehl am platz

  • gerade ging es jetzt geht es schon wieder net :(
    wieso bitte um eine schnelle fehler behandlung :)
    bitte hilft mir jemand


    dcmd_fill(playerid,params[])
    {
    #pragma unused params
    new carid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid))
    {
    SendClientMessage(playerid,Rot,"Du musst in einem Fahrzeug sitzen!");
    return 1;
    }
    if(GetPlayerState(playerid) != 2)
    {
    SendClientMessage(playerid,Rot,"Du kannst nur als Fahrer tanken!");
    return 1;
    }
    if(IsANoTachoCar(carid))
    {
    SendClientMessage(playerid,Rot,"Dieses Fahrzeug hat keinen Tank!");
    return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid,2.0,1000.5323,-940.9221,42.1487)
    || IsPlayerInRangeOfPoint(playerid,2.0,1007.1821,-933.7119,42.1731) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,1938.9042,-1776.3755,13.3808)
    || IsPlayerInRangeOfPoint(playerid,2.0,1944.3123,-1769.3580,13.3820) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,1380.9349,463.2896,20.1310)
    || IsPlayerInRangeOfPoint(playerid,2.0,1383.0538,455.8885,19.8995) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,653.2905,-569.9843,16.3285)
    || IsPlayerInRangeOfPoint(playerid,2.0,658.3235,-559.7913,16.3278)
    || IsPlayerInRangeOfPoint(playerid,2.0,-99.2766,-1171.7705,2.4701) //tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-87.3254,-1163.7476,2.2241) //tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1667.5259,410.9921,7.1734)
    || IsPlayerInRangeOfPoint(playerid,2.0,-1680.2010,411.9779,7.1708)
    || IsPlayerInRangeOfPoint(playerid,2.0,-2029.4103,158.7331,28.8301) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-2024.0455,154.7949,28.8271)
    || IsPlayerInRangeOfPoint(playerid,2.0,-2413.9492,970.0224,45.2878) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-2407.4719,982.5601,45.2859)
    || IsPlayerInRangeOfPoint(playerid,2.0,-2248.6003,-2558.2173,31.8950) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1605.4547,-2714.4626,48.5321)
    || IsPlayerInRangeOfPoint(playerid,2.0,2115.1289,923.3563,10.8127) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1464.8555,1858.5363,32.6268)
    || IsPlayerInRangeOfPoint(playerid,2.0,-1477.6841,1865.5970,32.6286) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1329.5178,2672.1833,50.0551)
    || IsPlayerInRangeOfPoint(playerid,2.0,-1327.6125,2682.8066,50.0548)) // tankw


    {
    SendClientMessage(playerid,Rot,"Du bist an keiner Tankstelle!");
    return 1;
    }
    GameTextForPlayer(playerid,"~y~Bitte Warten..",3000,4);
    TogglePlayerControllable(playerid, 0);
    SetTimerEx("Tanken",10000,0,"i",playerid);
    Betanken[playerid] = 1;
    return 1;
    }

    3 Mal editiert, zuletzt von EliteCake () aus folgendem Grund: text,text

  • in dem falle solltest du ein else verwenden also so dann


    if(IsPlayerInRangeOfPoint(playerid,2.0,1000.5323,-940.9221,42.1487)
    || IsPlayerInRangeOfPoint(playerid,2.0,1007.1821,-933.7119,42.1731) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,1938.9042,-1776.3755,13.3808)
    || IsPlayerInRangeOfPoint(playerid,2.0,1944.3123,-1769.3580,13.3820) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,1380.9349,463.2896,20.1310)
    || IsPlayerInRangeOfPoint(playerid,2.0,1383.0538,455.8885,19.8995) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,653.2905,-569.9843,16.3285)
    || IsPlayerInRangeOfPoint(playerid,2.0,658.3235,-559.7913,16.3278)
    || IsPlayerInRangeOfPoint(playerid,2.0,-99.2766,-1171.7705,2.4701) //tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-87.3254,-1163.7476,2.2241) //tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1667.5259,410.9921,7.1734)
    || IsPlayerInRangeOfPoint(playerid,2.0,-1680.2010,411.9779,7.1708)
    || IsPlayerInRangeOfPoint(playerid,2.0,-2029.4103,158.7331,28.8301) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-2024.0455,154.7949,28.8271)
    || IsPlayerInRangeOfPoint(playerid,2.0,-2413.9492,970.0224,45.2878) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-2407.4719,982.5601,45.2859)
    || IsPlayerInRangeOfPoint(playerid,2.0,-2248.6003,-2558.2173,31.8950) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1605.4547,-2714.4626,48.5321)
    || IsPlayerInRangeOfPoint(playerid,2.0,2115.1289,923.3563,10.8127) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1464.8555,1858.5363,32.6268)
    || IsPlayerInRangeOfPoint(playerid,2.0,-1477.6841,1865.5970,32.6286) // tankw
    || IsPlayerInRangeOfPoint(playerid,2.0,-1329.5178,2672.1833,50.0551)
    || IsPlayerInRangeOfPoint(playerid,2.0,-1327.6125,2682.8066,50.0548)) // tankw


    {
    GameTextForPlayer(playerid,"~y~Bitte Warten..",3000,4);
    TogglePlayerControllable(playerid, 0);
    SetTimerEx("Tanken",10000,0,"i",playerid);
    Betanken[playerid] = 1;
    }else{ return SendClientMessage(playerid,Rot,"Du bist an keiner Tankstelle!");}