Problem mit Fraktionscars

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 wollte mir Fraktionscars erstellen. Das habe ich gemacht:
    Ganzt oben(Globale Variable)

    //FraktionsCars
    //LSPD Cars
    new lspdcar[40];


    Bei publicOnGameModeInit

    //Polizei Cars
    lspdcar[0]=SetVehicleNumberPlate(AddStaticVehicle(431,1564.1998,-1693.7444,5.9923,269.7487,55,83),"LSPD - Bus"); // pb0
    lspdcar[1]=SetVehicleNumberPlate(AddStaticVehicle(427,1529.0931,-1687.9348,6.0234,270.1188,0,1),"LSPD - T1"); // pt0
    lspdcar[2]=SetVehicleNumberPlate(AddStaticVehicle(427,1529.0342,-1683.9507,6.0225,269.5923,0,1),"LSPD - T2"); // pt1
    lspdcar[3]=SetVehicleNumberPlate(AddStaticVehicle(523,1525.6560,-1643.2468,5.4497,180.8065,0,0),"LSPD - B1"); // pb0
    lspdcar[4]=SetVehicleNumberPlate(AddStaticVehicle(523,1527.7333,-1643.0054,5.4552,179.9027,0,0),"LSPD - B1"); // pb1
    lspdcar[5]=SetVehicleNumberPlate(AddStaticVehicle(523,1529.2393,-1642.9535,5.4607,180.6745,0,0),"LSPD - B2"); // pb2
    lspdcar[6]=SetVehicleNumberPlate(AddStaticVehicle(523,1531.9308,-1642.9342,5.4599,178.5295,0,0),"LSPD - B3"); // pb3
    lspdcar[7]=SetVehicleNumberPlate(AddStaticVehicle(523,1533.4946,-1642.5997,5.4617,181.1923,0,0),"LSPD - B4"); // pb4
    lspdcar[8]=SetVehicleNumberPlate(AddStaticVehicle(523,1535.8306,-1642.7858,5.4555,180.7914,0,0),"LSPD - B5"); // pb5
    lspdcar[9]=SetVehicleNumberPlate(AddStaticVehicle(523,1537.4309,-1642.8792,5.4551,180.5506,0,0),"LSPD - B6"); // pb6
    lspdcar[10]=SetVehicleNumberPlate(AddStaticVehicle(523,1539.8877,-1643.1803,5.4552,182.7480,0,0),"LSPD - B7"); // pb7
    lspdcar[11]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.5210,-1649.7391,5.4618,90.4330,0,0),"LSPD - B8"); // pb8
    lspdcar[12]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.2708,-1652.0299,5.4620,92.3683,0,0),"LSPD - B9"); // pb9
    lspdcar[13]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.2559,-1653.8173,5.4605,86.9998,0,0),"LSPD - B10"); // pb10
    lspdcar[14]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.2942,-1656.1742,5.4641,88.7510,0,0),"LSPD - B11"); // pb11
    lspdcar[15]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.1857,-1658.0712,5.4564,89.6910,0,0),"LSPD - B12"); // pb12
    lspdcar[16]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.2478,-1660.2510,5.4638,93.2451,0,0),"LSPD - B13"); // pb13
    lspdcar[17]=SetVehicleNumberPlate(AddStaticVehicle(523,1547.1946,-1661.8451,5.4550,88.7967,0,0),"LSPD - B14"); // pb14
    lspdcar[18]=SetVehicleNumberPlate(AddStaticVehicle(523,1546.9713,-1664.2435,5.4656,89.1477,0,0),"LSPD - B15"); // pb15
    lspdcar[19]=SetVehicleNumberPlate(AddStaticVehicle(599,1545.8145,-1667.9468,6.0776,89.9549,0,1),"LSPD - R1"); // pr0
    lspdcar[20]=SetVehicleNumberPlate(AddStaticVehicle(599,1545.8329,-1672.0656,6.0802,89.8559,0,1),"LSPD - R2"); // pr1
    lspdcar[21]=SetVehicleNumberPlate(AddStaticVehicle(599,1545.6993,-1676.2813,6.0822,90.7889,0,1),"LSPD - R3"); // pr2
    lspdcar[22]=SetVehicleNumberPlate(AddStaticVehicle(599,1545.8301,-1680.2618,6.0790,89.8099,0,1),"LSPD - R4"); // pr3
    lspdcar[23]=SetVehicleNumberPlate(AddStaticVehicle(599,1546.1829,-1684.5308,6.0810,89.8386,0,1),"LSPD - R5"); // pr4
    lspdcar[24]=SetVehicleNumberPlate(AddStaticVehicle(599,1558.8394,-1711.4764,6.0787,1.5649,0,1),"LSPD - R6"); // pr5
    lspdcar[25]=SetVehicleNumberPlate(AddStaticVehicle(599,1570.2655,-1711.4293,6.0799,0.6183,0,1),"LSPD - R7"); // pr6
    lspdcar[26]=SetVehicleNumberPlate(AddStaticVehicle(599,1574.3682,-1711.6230,6.0825,0.2347,0,1),"LSPD - R8"); // pr7
    lspdcar[27]=SetVehicleNumberPlate(AddStaticVehicle(599,1578.4917,-1711.0789,6.0796,0.5039,0,1),"LSPD - R9"); // pr8
    lspdcar[28]=SetVehicleNumberPlate(AddStaticVehicle(596,1583.5216,-1710.2197,5.6115,359.4248,0,1),"LSPD - 01"); // pc0
    lspdcar[29]=SetVehicleNumberPlate(AddStaticVehicle(596,1587.5240,-1710.5760,5.6122,1.1491,0,1),"LSPD - 02"); // pc1
    lspdcar[30]=SetVehicleNumberPlate(AddStaticVehicle(596,1591.4504,-1710.3788,5.6118,359.3870,0,1),"LSPD - 03"); // pc2
    lspdcar[31]=SetVehicleNumberPlate(AddStaticVehicle(596,1595.4634,-1710.2003,5.6120,359.7828,0,1),"LSPD - 04"); // pc3
    lspdcar[32]=SetVehicleNumberPlate(AddStaticVehicle(596,1601.4241,-1704.4741,5.6117,89.5413,0,1),"LSPD - 05"); // pc4
    lspdcar[33]=SetVehicleNumberPlate(AddStaticVehicle(596,1601.6859,-1700.1459,5.6123,90.5046,0,1),"LSPD - 06"); // pc5
    lspdcar[34]=SetVehicleNumberPlate(AddStaticVehicle(596,1602.0677,-1696.4200,5.6119,88.8252,0,1),"LSPD - 07"); // pc6
    lspdcar[35]=SetVehicleNumberPlate(AddStaticVehicle(596,1601.9043,-1691.8660,5.6125,91.1064,0,1),"LSPD - 08"); // pc7
    lspdcar[36]=SetVehicleNumberPlate(AddStaticVehicle(596,1601.3140,-1687.8452,5.6136,90.5289,0,1),"LSPD - 09"); // pc8
    lspdcar[37]=SetVehicleNumberPlate(AddStaticVehicle(596,1601.4844,-1683.9429,5.6110,90.3809,0,1),"LSPD - 10"); // pc9
    lspdcar[38]=SetVehicleNumberPlate(AddStaticVehicle(541,1585.5413,-1667.5079,5.5171,270.9277,0,0),"LSPD - SC1"); // psc0
    lspdcar[39]=SetVehicleNumberPlate(AddStaticVehicle(541,1585.0520,-1671.6473,5.5182,271.2342,0,0),"LSPD - SC2"); // psc1




    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,"Fraktion")!=1)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Rot,"Du darfst dieses Fahrzeug nicht fahren, da du nicht in der Fraktion bist");
    }
    }
    }
    }
    return 1;
    }



    aber Irgendwie funktionierd das trotzdem nicht so ganz.
    trotzdem kann jeder mit den autos fahren.
    warum?

    Mit freundlich Grüßen
    Euer Scrubs Fan und Suchti
    JohnDorian