Frak Car Problem

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
  • Hey
    Folgendes Problem habe ich bei den Frak Cars:













    //Yakuza
    yakuzacars[0] = AddStaticVehicle(560,2603.0166,1862.6141,10.7325,271.3289,1,1); // Yaki Car
    yakuzacars[1] = AddStaticVehicle(560,2603.0142,1852.9771,10.7321,270.2483,1,1); // Yaki Car
    yakuzacars[2] = AddStaticVehicle(560,2603.0962,1843.4880,10.7310,270.2532,1,1); // Yaki Car
    yakuzacars[3] = AddStaticVehicle(560,2603.1411,1833.8165,10.7310,269.9236,1,1); // Yaki Car
    yakuzacars[4] = AddStaticVehicle(560,2591.7039,1833.8097,10.5897,88.9054,1,1); // Yaki Car
    yakuzacars[5] = AddStaticVehicle(560,2591.7241,1843.3949,10.5897,89.9374,1,1); // Yaki Car
    yakuzacars[6] = AddStaticVehicle(560,2591.6970,1852.9272,10.5896,90.0618,1,1); // Yaki Car
    yakuzacars[7] = AddStaticVehicle(560,2591.6750,1862.5424,10.5935,90.2700,1,1); // Yaki Car
    yakuzacars[8] = AddStaticVehicle(480,2597.0710,1885.0696,10.5972,89.3406,1,1); // Yaki Car Comet
    yakuzacars[9] = AddStaticVehicle(560,2583.4075,1897.2020,10.9816,179.7039,1,1); // Yaki Car
    yakuzacars[10] = AddStaticVehicle(411,2576.6582,1897.2509,10.9906,179.6376,1,1); // Yaki Car Infernus
    yakuzacars[11] = AddStaticVehicle(560,2570.3337,1897.2622,10.9829,179.7936,1,1); // Yaki Car
    yakuzacars[12] = AddStaticVehicle(487, 2575.5784, 1766.4211, 12.7732, 269.6274,1,1); //Yaki Car
    yakuzacars[13] = AddStaticVehicle(487, 2611.9880,1897.5394,10.5253,179.8560,1,1); //Yaki Car FCR1
    yakuzacars[14] = AddStaticVehicle(487, 2618.2349,1897.3531,10.5255,180.3308,1,1); //Yaki Car FCR2
    yakuzacars[15] = AddStaticVehicle(487, 2624.6006,1897.6027,10.5256,180.6758,1,1); //Yaki Car FCR3
















    if(Spieler[playerid][Team] != 9)
    {
    for(new i=0;i<sizeof(yakuzacars);i++)
    {
    if(newcar == yakuzacars)
    {
    SendClientMessage(playerid,COLOR_RED,"Du hast keine Schlüssel!");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    }
    }
    }


    [/pwn]










    Warum kann jeder die Frak Cars fahren.


    Danke im Vorraus.




    Mfg.Maxi

    MfG

  • if(Spieler[playerid][Team] != 9)
    {
    }
    else
    {
    for(new i=0;i<sizeof(yakuzacars);i++)
    {
    if(newcar == yakuzacars)
    {
    SendClientMessage(playerid,COLOR_RED,"Du hast keine Schlüssel!");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    }
    }
    }
    Versuch es mal so

  • probiers so, uinter OnPlayerStateChange

    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i=0;i<sizeof(yakuzacars);i++)
    {
    if(GetPlayerVehicleID(playerid) == yakuzacars[i])
    {
    if(Spieler[playerid][Team] != 9)
    {
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du hast keine Schlüssel!");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    }
    }
    }
    }

  • if(Spieler[playerid][Team] == 9)


    {


    for(new i=0;i<sizeof(yakuzacars);i++)


    {


    if(newcar == yakuzacars)


    {


    SendClientMessage(playerid,COLOR_RED,"Du hast keine Schlüssel!");


    RemovePlayerFromVehicle(playerid);


    TogglePlayerControllable(playerid,false);


    TogglePlayerControllable(playerid,true);


    }


    }


    }


    Aber ich kann es als Zivi immer noch fahren

    MfG

  • mach es so:


    forward remove(playerid);


    onplayerentervehicle(das public)


    for(new i = 0; i<MAX_VEHICLES; i++)
    {
    if(vehicleid == Yakicaras[i])
    {
    if(FRaktion != fraktid)return SetTimerEx("remove",5000,false,"i",playerid);
    }
    }


    public remove(playerid)
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { RemovePlayerFromVehicle(playerid); }
    }