Jump to content

Question

Posted

Salut, am o problema la licente. Mereu cand intru intr-un avion sau barca, imi zice ca nu am licenta de driving, daca imi dau licenta de driving, merge sa conduc si masina, sa pilotez si avionu, si sa merg si cu barca. Stie cineva de ce? 

COD: public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(!isBike(GetVehicleModel(vehicleid)) && PlayerInfo[playerid][pDrivingLic] == 0)
        {
            ClearAnimations(playerid);
            return SCM(playerid, COLOR_GREY, "You need a driving license to use this vehicle.");
        }
        if(isBoat(GetVehicleModel(vehicleid)) && PlayerInfo[playerid][pBoatLic] == 0)
        {
            ClearAnimations(playerid);
            return SCM(playerid, COLOR_GREY, "You need a boat license use this boat.");
        }
        if(isPlane(GetVehicleModel(vehicleid)) && PlayerInfo[playerid][pFlyLic] == 0)
        {
            ClearAnimations(playerid);
            return SCM(playerid, COLOR_GREY, "You need a fly licenses to use this plane.");
        }                
    }
    return 1;
}

1 answer to this question

Recommended Posts

  • 0
Posted

Salut @Raduq,

Trebuie sa detectezi si daca vehiculul in care urca e diferit fata de un avion si de o barca. Atunci cand jucatorul urca intr-un vehicul, la tine in script detectezi doar daca e bicicleta. Exemplu de rezolvare:

new vehModel = GetVehicleModel(vehicleid); //ajuta la citirea codului mai bine
if(!isBike(vehModel) && !isPlane(vehModel) && !isBoat(vehModel) && PlayerInfo[playerid][pDrivingLic] == 0)

 

  • Upvote 1

Daca te-am ajutat =>

spacer.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.