Problem mt den Fraktions Autos

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
  • Guten Abend,


    Ich mochte in meinem Selfmade Script das Fraktionsaustos auch nur von Fraktionsmitgliedern gefahren werden können.


    Mein Problem : Wenn ich in der Fraktion bin kann ich trozdme nicht mit fahren.



    new lspdcar[17];
    new fbicar[13];


    //****FRAKTIONEN****
    #define sFraktion1 "FBI"
    #define sFraktion2 "Army"
    #define sFraktion3 "Medic"
    #define sFraktion4 "Cripz"
    #define sFraktion5 "LSPD"




    lspdcar[0] = AddStaticVehicle(596,1558.8214,-1711.8292,5.6134,0.1041,0,1); // LSPDCAR1
    lspdcar[1] = AddStaticVehicle(596,1563.2158,-1711.8081,5.6064,359.4832,0,1); // LSPDCAR2
    lspdcar[2] = AddStaticVehicle(596,1567.2958,-1711.8245,5.6120,0.5418,0,1); // LSPDCAR3
    lspdcar[3] = AddStaticVehicle(596,1571.0765,-1711.8069,5.6119,0.3090,0,1); // LSPDCAR4
    lspdcar[4] = AddStaticVehicle(596,1574.9081,-1711.7944,5.6109,359.9996,0,1); // LSPDCAR5
    lspdcar[5] = AddStaticVehicle(599,1583.5323,-1711.8015,6.0791,359.4035,0,1); // LSPDRANGER1
    lspdcar[6] = AddStaticVehicle(599,1587.4800,-1711.8296,6.0761,359.7726,0,1); // LSPDRANGER2
    lspdcar[7] = AddStaticVehicle(599,1591.5393,-1711.8273,6.0810,359.5041,0,1); // LSPDRANGER3
    lspdcar[8] = AddStaticVehicle(599,1595.3929,-1711.7968,6.0799,359.4140,0,1); // LSPDRANGER4
    lspdcar[9] = AddStaticVehicle(601,1538.5674,-1644.4175,5.6494,181.7021,1,1); // LSPDWERFER1
    lspdcar[10] = AddStaticVehicle(601,1534.7521,-1644.5061,5.6494,180.1076,1,1); // LSPDWERFER2
    lspdcar[11] = AddStaticVehicle(601,1530.5850,-1644.5281,5.6494,180.4031,1,1); // LSPDWERFER3
    lspdcar[12] = AddStaticVehicle(427,1545.3363,-1684.2312,6.0210,89.2654,0,1); // LSPDTRUCK1
    lspdcar[13] = AddStaticVehicle(427,1545.3875,-1680.1105,6.0225,90.6659,0,1); // LSPDTRUCK2
    lspdcar[14] = AddStaticVehicle(427,1545.4211,-1676.0321,6.0215,90.1578,0,1); // LSPDTRUCK3
    lspdcar[15] = AddStaticVehicle(415,1585.5592,-1667.4921,5.6638,271.0377,75,1); // LSPDLEADER1
    lspdcar[16] = AddStaticVehicle(415,1585.6455,-1671.5266,5.6648,270.4637,0,1); // LSPDLEADER2


    fbicar[0] = AddStaticVehicle(490,302.9007,-1499.6223,24.7266,235.5045,0,0); // FBIRANGER1
    fbicar[1] = AddStaticVehicle(490,300.0546,-1503.7345,24.7244,234.1233,0,0); // FBIRANGER2
    fbicar[2] = AddStaticVehicle(490,296.8752,-1508.3938,24.7221,235.5079,0,0); // FBIRANGER3
    fbicar[3] = AddStaticVehicle(522,308.7924,-1482.4363,24.1684,197.2633,39,106); // NRG1
    fbicar[4] = AddStaticVehicle(522,305.9598,-1482.0381,24.1649,201.4626,3,3); // NRG2
    fbicar[5] = AddStaticVehicle(522,302.1595,-1486.0896,24.1677,195.6949,6,25); // NRG3
    fbicar[6] = AddStaticVehicle(522,305.3916,-1486.9694,24.1537,195.6750,8,82); // NRG4
    fbicar[7] = AddStaticVehicle(523,300.1926,-1491.5677,24.1648,200.2108,0,0); // motorrad!
    fbicar[8] = AddStaticVehicle(523,302.7993,-1491.3370,24.1658,200.1699,0,0); // motorrad"
    fbicar[9] = AddStaticVehicle(528,290.0634,-1517.2845,24.6367,235.2999,0,0); // FBI SAPD1
    fbicar[10] = AddStaticVehicle(528,287.0912,-1521.5524,24.6367,234.7863,0,0); // FBI SAPD2
    fbicar[11] = AddStaticVehicle(415,291.6402,-1545.3818,24.3652,55.8259,40,1); // FBILEADER1
    fbicar[12] = AddStaticVehicle(415,294.7054,-1540.4664,24.3656,54.9884,75,1); // FBILEADER2



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(lspdcar); i++)
    {
    if(GetPlayerVehicleID(playerid)==lspdcar[i])
    {
    if(GetPVarInt(playerid,"sFraktion")!=5)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht in dieser Fraktion [LSPD].");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(fbicar); i++)
    {
    if(GetPlayerVehicleID(playerid)==fbicar[i])
    {
    if(GetPVarInt(playerid,"sFraktion")!=1)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht in dieser Fraktion [FBI].");
    }
    }
    }
    }

    return 1;
    }

  • Komisch.. mach dich mal in ne andere Fraktion und test es..


    wenn nicht probier es so


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(lspdcar); i++)
    {
    if(GetPlayerVehicleID(playerid)==lspdcar[i])
    {
    if(GetPVarInt(playerid,"sFraktion")=5)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht in dieser Fraktion [LSPD].");
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht in dieser Fraktion [LSPD].");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(fbicar); i++)
    {
    if(GetPlayerVehicleID(playerid)==fbicar[i])
    {
    if(GetPVarInt(playerid,"sFraktion") =1)
    {


    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht in dieser Fraktion [FBI].");
    }
    }
    }
    }

    return 1;
    }

  • public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(mafiacar); i++)
    {
    if(GetPlayerVehicleID(playerid)==mafiacar[i])
    {
    if(GetPVarInt(playerid,"Fraktion")!=2)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,ROT,"Du darfst dieses Fahrzeug nicht fahren.");
    }
    }
    }
    }
    return 1;
    }

  • dcmd_makeleader(playerid,params[])
    {
    new pid, frakid;
    if(sscanf(params,"ud",pid,frakid))
    {
    return SendClientMessage(playerid,Grau,"Verwendung : /makleader [ID] [Fraktions ID]");
    }
    if(frakid > 5)
    {
    return SendClientMessage(playerid,Grau,"Soviele Fraktionen gibt es nicht!");
    }
    if(IstSpielerAdmin(playerid, 5))
    {
    if(pid == INVALID_PLAYER_ID)
    {
    return SendClientMessage(playerid,Grau,"Ungültiger Spieler!");
    }
    if(IstSpielerInFraktion(pid,frakid) == frakid)
    {
    return SendClientMessage(playerid,Rot,"Der angegebene Spieler ist schon in dieser Fraktion!");
    }
    else
    {
    sSpieler[pid][Fraktion] = frakid;
    SendClientMessage(pid,Gelb,"Du bist nun in einer Fraktion!");
    SendClientMessage(pid,Gelb,"Du hast den angegeben Spieler in eine Fraktion gepackt!");
    }
    }
    else
    {
    return SendClientMessage(playerid,Rot,"Du bist kein Admin!");
    }
    return 1;
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen