Frakcar bug :c

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
  • Ich hab etz hier den code aber das geht mir nicht:


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    new spdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(spdatei,sizeof(spdatei),"/Spieler/%s.txt",name);
    for(new i=0; i<sizeof(pdcars); i++)
    {
    if(GetPlayerVehicleID(playerid)==pdcars[i])
    {
    if(GetPVarInt(playerid,"Fraktion") == 0)
    {
    TogglePlayerControllable(playerid,0);
    TogglePlayerControllable(playerid,1);
    }
    }
    }
    return 1;
    }



    meine cars:
    public OnGameModeInit()
    {
    SetGameModeText("It's Roleplay");
    DisableInteriorEnterExits();
    EnableStuntBonusForAll(0);
    SetTimerEx("Blitzer_Timer", BLITZER_TIMER_INTERVALL, 1,"i");
    pdcars[0]=AddStaticVehicle(596,1601.9071,-1684.2040,5.6111,90.6188,0,1); // PD1
    pdcars[1]=AddStaticVehicle(596,1602.4087,-1688.0742,5.6121,88.7209,0,1); // PD2
    pdcars[2]=AddStaticVehicle(596,1600.6130,-1691.8049,5.6123,90.9331,0,1); // PD3
    pdcars[3]=AddStaticVehicle(596,1600.7987,-1696.2317,5.6129,89.9640,0,1); // PD4
    pdcars[4]=AddStaticVehicle(596,1600.8124,-1700.2335,5.6094,89.7960,0,1); // PD5
    pdcars[5]=AddStaticVehicle(596,1600.5302,-1704.3290,5.6119,91.7927,0,1); // PD6
    pdcars[6]=AddStaticVehicle(599,1526.9954,-1646.8000,6.0813,180.3619,0,1); // PD7
    pdcars[7]=AddStaticVehicle(599,1530.8228,-1645.1415,6.0755,180.9456,0,1); // PD8
    pdcars[8]=AddStaticVehicle(599,1534.7310,-1646.1417,6.0794,180.8065,0,1); // PD9
    pdcars[9]=AddStaticVehicle(599,1538.5476,-1646.4534,6.0821,179.3053,0,1); // PD10
    pdcars[10]=AddStaticVehicle(599,1544.6266,-1651.4513,6.0769,91.2445,0,1); // PD11
    pdcars[11]=AddStaticVehicle(598,1544.2119,-1655.3127,5.6318,86.8258,0,1); // PD12
    pdcars[12]=AddStaticVehicle(598,1543.0275,-1659.0039,5.6373,87.9473,0,1); // PD13
    pdcars[13]=AddStaticVehicle(598,1545.0125,-1662.7202,5.6363,88.3559,0,1); // PD14
    pdcars[14]=AddStaticVehicle(598,1545.9520,-1667.9072,5.6372,92.8925,0,1); // PD15
    pdcars[15]=AddStaticVehicle(598,1543.6979,-1672.0725,5.6409,88.8183,0,1); // PD16
    pdcars[16]=AddStaticVehicle(598,1543.4048,-1676.3209,5.6399,88.0957,0,1); // PD17
    pdcars[17]=AddStaticVehicle(598,1543.0619,-1680.7831,5.6375,88.3582,0,1); // PD18
    pdcars[18]=AddStaticVehicle(598,1545.1174,-1683.9683,5.6378,90.3321,0,1); // PD19
    pdcars[19]=AddStaticVehicle(598,1530.0485,-1684.2091,5.6384,89.7693,0,1); // PD20
    pdcars[20]=AddStaticVehicle(598,1528.8342,-1687.7418,5.6363,97.5751,0,1); // PD21
    return 1;
    }



    Egal in welches auto ich einsteige ich werde gefrezzed und enfeezed

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • Vllt.
    So:


    if(!IsPlayerInFrac(playerid,3))
    {
    for(new pv = 0; pv < sizeof(LVPDVehs); pv++)
    {
    if(newcar == LVPDVehs[pv])
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist nicht bei der LVPD");
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    Musste halt anpassen!

  • public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i = 0; i<sizeof(pdcars); i++)
    {
    if(GetPlayerVehicleID(playerid) == pdcars[i])
    {
    if(IsPlayerInFrakt(playerid,3))
    {

    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,DROT,"Du bist kein Mitglied des LSPD´s");
    }
    }
    }
    }
    return 1;
    }



    Hier.
    Alles angepasst.
    @Music4You:
    So richtig?

    Einmal editiert, zuletzt von exxoticx ()

  • kann es vll sein das du dir Hier Verschrieben hast?

    PHP
    GetPVarInt(playerid,"Fraktion")

    das es so einmal steht und einmal so

    PHP
    GetPVarInt(playerid,"fraktion")

    Mit Freundlichen Grüßen
    Whitetiiger aka. Kaito-sensei
    P.s. Alle mit #IRONIE bestätigten Sätze von mir, sind als Ironie anzusehen.

  • Wenn überhaupt, dann so:



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i = 0; i<sizeof(pdcars); i++)
    {
    if(GetPlayerVehicleID(playerid) == pdcars[i])
    {
    if(GetPVarInt(playerid, "Fraktion") != 3)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFFFFFFFF,"Du bist kein Mitglied des LSPD´s");
    }
    break;
    }
    }
    }
    return 1;
    }

  • das letzt geht aber wieso !=3 ? 1 ist PD
    und was zum fck is break ?

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Danke ihr hammer leute <33 ;)

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox