Problem bei OnPlayerEnterVehicle

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
  • ah super!
    Dankeschön an alle die mir geholfen habe!
    Vorallem an Blackfox, Suggalike und Basti!


    MfG Markus ;)


    EDIT: Habe es jetzt mal getestet.


    Es funktioniert nur beim Arzt Car! Beim Cop, Fahrlehrer und Taxicar net.
    Hier der Script:


    Oben

    new copcar[24];
    new arztcar[8];
    new taxicar[12];
    new fahrlehrercar[5];


    BeiOnGameModeInit

    copcar[0] = CreateVehicle(601,1535.9340,-1667.6667,13.1416,359.9212,1,0,-5);
    copcar[1] = CreateVehicle(599,1585.9211,-1667.6064,6.0807,269.0763,1,0,-5); //
    copcar[2] = CreateVehicle(599,1586.2998,-1671.7700,6.0842,271.3959,1,0,-5); //
    copcar[3] = CreateVehicle(596,1601.0112,-1683.9260,5.6118,90.1488,1,0,-5); //
    copcar[4] = CreateVehicle(596,1601.0848,-1687.7618,5.6120,89.9984,1,0,-5); //
    copcar[5] = CreateVehicle(596,1600.8187,-1692.1112,5.6119,89.3539,1,0,-5); //
    copcar[6] = CreateVehicle(596,1600.8096,-1695.9375,5.6134,88.9230,1,0,-5); //
    copcar[7] = CreateVehicle(596,1600.7686,-1700.1107,5.6119,89.0756,1,0,-5); //
    copcar[8] = CreateVehicle(596,1600.4762,-1704.0974,5.6119,90.8142,1,0,-5); //
    copcar[9] = CreateVehicle(523,1595.3848,-1710.0406,5.4563,2.4629,1,0,-5); //
    copcar[10] = CreateVehicle(523,1591.6775,-1709.3964,5.4547,1.5955,1,0,-5); //
    copcar[11] = CreateVehicle(523,1587.6079,-1709.9120,5.4620,0.9339,1,0,-5); //
    copcar[12] = CreateVehicle(523,1583.5455,-1710.0194,5.4610,359.8681,1,0,-5); //
    copcar[13] = CreateVehicle(490,1529.4569,-1688.0471,6.0201,269.6975,1,0,-5); //
    copcar[14] = CreateVehicle(490,1529.4573,-1684.1069,6.0180,269.6851,1,0,-5); //
    copcar[15] = CreateVehicle(490,1544.7567,-1684.0559,6.0180,90.0050,1,0,-5); //
    copcar[16] = CreateVehicle(490,1544.4733,-1680.2100,6.0193,90.6690,1,0,-5); //
    copcar[17] = CreateVehicle(490,1544.1262,-1676.1085,6.0165,89.7053,1,0,-5); //
    copcar[18] = CreateVehicle(433,1526.5542,-1645.6567,6.3273,182.5343,1,0,-5); //
    copcar[19] = CreateVehicle(432,1545.0610,-1670.3079,5.9034,0.1218,1,0,-5); //
    copcar[20] = CreateVehicle(432,1544.7288,-1657.5378,5.9042,359.7016,1,0,-5); //
    copcar[21] = CreateVehicle(427,1530.1917,-1645.9215,6.0225,181.8068,1,0,-5); //
    copcar[22] = CreateVehicle(427,1534.4128,-1645.5245,6.0223,180.7396,1,0,-5); //
    copcar[23] = CreateVehicle(601,1538.8906,-1646.9222,5.6495,179.7636,1,0,-5); //


    arztcar[0] = CreateVehicle(416,1178.3995,-1338.3440,14.0152,272.5944,0,3,-5); //
    arztcar[1] = CreateVehicle(416,1178.5140,-1308.6309,13.9756,271.3011,0,3,-5); //
    arztcar[2] = CreateVehicle(416,1184.6239,-1315.1733,13.7181,268.4643,0,3,-5); //
    arztcar[3] = CreateVehicle(416,1185.2784,-1332.6115,13.7208,270.4677,0,3,-5); //
    arztcar[4] = CreateVehicle(407,1220.8021,-1332.5055,13.7169,90.8146,3,0,-5); //
    arztcar[5] = CreateVehicle(407,1220.7251,-1328.8525,13.7182,90.8351,3,0,-5); //
    arztcar[6] = CreateVehicle(407,1220.6619,-1325.0007,13.7205,91.9381,3,0,-5); //
    arztcar[7] = CreateVehicle(407,1220.8419,-1321.0459,13.7199,90.3782,3,0,-5); //


    taxicar[0] = CreateVehicle(437,1800.4434,-1933.2710,13.5198,90.3962,0,6,-5); //
    taxicar[1] = CreateVehicle(437,1800.3806,-1929.6278,13.5212,90.4939,0,6,-5); //
    taxicar[2] = CreateVehicle(437,1800.2245,-1925.9827,13.5230,91.0447,0,6,-5); //
    taxicar[3] = CreateVehicle(431,1800.4274,-1922.0133,13.4939,91.7014,0,6,-5); //
    taxicar[4] = CreateVehicle(431,1800.2250,-1918.2267,13.4876,90.7607,0,6,-5); //
    taxicar[5] = CreateVehicle(431,1800.1713,-1914.4838,13.5049,91.3471,0,6,-5); //
    taxicar[6] = CreateVehicle(420,1777.8831,-1933.5383,13.1665,269.7246,0,6,-5); //
    taxicar[7] = CreateVehicle(420,1777.8456,-1929.9551,13.1663,271.5384,0,6,-5); //
    taxicar[8] = CreateVehicle(420,1777.7175,-1926.8242,13.1672,272.5280,0,6,-5); //
    taxicar[9] = CreateVehicle(438,1777.3339,-1922.6516,13.3911,270.7075,0,6,-5); //
    taxicar[10] = CreateVehicle(438,1777.3325,-1918.6694,13.3900,269.4254,0,6,-5); //
    taxicar[11] = CreateVehicle(438,1777.4934,-1914.8943,13.3894,269.9102,0,6,-5); //

    fahrlehrercar[0] = CreateVehicle(426,1259.3402,-1796.4022,13.1673,146.3866,1,2,-5); //
    fahrlehrercar[1] = CreateVehicle(426,1265.0206,-1796.2506,13.1564,179.5209,1,2,-5); //
    fahrlehrercar[2] = CreateVehicle(426,1267.9789,-1796.5527,13.1506,179.9579,1,2,-5); //
    fahrlehrercar[3] = CreateVehicle(426,1271.0334,-1796.4813,13.1456,179.9595,1,2,-5); //


    Bei OnPlayerStateChange

    if(newstate == 2)
    {
    if(IsCopCar(GetPlayerVehicleID(playerid)))
    {
    if(gTeam[playerid] != TEAM_POLIZEI)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFFFFFFFF,"Du bist kein Polizist!");
    }
    }
    }

    if(newstate == 2)
    {
    if(IsArztCar(GetPlayerVehicleID(playerid)))
    {
    if(gTeam[playerid] != TEAM_ARZT)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFFFFFFFF,"Du bist kein Arzt oder Feuerwehrmann!");
    }
    }
    }

    if(newstate == 2)
    {
    if(IsTaxiCar(GetPlayerVehicleID(playerid)))
    {
    if(gTeam[playerid] != TEAM_TAXI)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFFFFFFFF,"Du bist kein Taxi oder Busfahrer!");
    }
    }
    }

    if(newstate == 2)
    {
    if(IsFahrlehrerCar(GetPlayerVehicleID(playerid)))
    {
    if(gTeam[playerid] != TEAM_FAHRLEHRER)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFFFFFFFF,"Du bist kein Fahrlehrer!");
    }
    }
    }


    Weiter unten im Script:

    forward IsCopCar(vehid);
    public IsCopCar(vehid)
    {
    for(new i = 0;i<sizeof(copcar);i++)
    {
    if(vehid == copcar[i])return 1;
    }
    return 0;
    }


    forward IsArztCar(vehid);
    public IsArztCar(vehid)
    {
    for(new i = 0;i<sizeof(arztcar);i++)
    {
    if(vehid == arztcar[i])return 1;
    }
    return 0;
    }


    forward IsTaxiCar(vehid);
    public IsTaxiCar(vehid)
    {
    for(new i = 0;i<sizeof(taxicar);i++)
    {
    if(vehid == taxicar[i])return 1;
    }
    return 0;
    }


    forward IsFahrlehrerCar(vehid);
    public IsFahrlehrerCar(vehid)
    {
    for(new i = 0;i<sizeof(fahrlehrercar);i++)
    {
    if(vehid == fahrlehrercar[i])return 1;
    }
    return 0;
    }


    Hoffe ihr könnt mir helfen!


    MfG Markus

    Einmal editiert, zuletzt von Markus ()