Jump to content
  • 0

Question

Posted

Salut ma puteti ajuta si pe mine va rog, am creat o factiune am add masini dar cand intru in masina de la respectiva factiune imi spune ca nu fac parte din factiunea respectiva.

Aici este codul de la OnPlayerEnterVehicle

Citat

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
    if(!ispassenger) {
        new vehicle = GetVehicleID(vehicleid), string[256];
        if(ServerVehicles[vehicle][vID] != 0 && JobWorking[playerid] == 0) {
            if(ServerVehicles[vehicle][vFaction] == 1 || ServerVehicles[vehicle][vFaction] == 2 || ServerVehicles[vehicle][vFaction] == 3 || ServerVehicles[vehicle][vFaction] == 14 || ServerVehicles[vehicle][vFaction] == 16) {
                if(!IsACop(playerid)) {
                    format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
                    SCM(playerid, COLOR_GREY, string);
                    SlapPlayer(playerid);
                }
                else if(OnDuty[playerid] == 0 && IsACop(playerid)) {
                    SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
                    SlapPlayer(playerid);
                    return true;
                }
                else if(ServerVehicles[vehicle][vRank] > PlayerInfo[playerid][pRank]) {
                    format(string, sizeof(string), "Ai nevoie de rank %d pentru a lua acest vehicul.", ServerVehicles[vehicle][vRank]);
                    SCM(playerid, COLOR_GREY, string);
                    SlapPlayer(playerid);
                }
            }
            else if(ServerVehicles[vehicle][vFaction] != PlayerInfo[playerid][pMember] && ServerVehicles[vehicle][vFaction] != 0) {
                format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
                SCM(playerid, COLOR_GREY, string);
                SlapPlayer(playerid);
            }
            else {
                if(OnDuty[playerid] == 0 && IsACop(playerid) && Copcar2(vehicle)) {
                    SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
                    SlapPlayer(playerid);
                    return true;
                }
            }
        }
        if(IsABoat(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
            if(PlayerInfo[playerid][pBoatLic] < 1 && InDealer[playerid] == 0 && InExamen[playerid] == 0) {
                SCM(playerid,COLOR_GREY, "Nu ai licenta de navigatie.");
                SlapPlayer(playerid);
                TogglePlayerControllable(playerid, 1);
            }
        }
        else if(IsAPlane(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
            if(PlayerInfo[playerid][pFlyLic] < 1 && InDealer[playerid] == 0) {
                SCM(playerid, COLOR_GREY, "Nu ai licenta de zbor.");
                SlapPlayer(playerid);
                TogglePlayerControllable(playerid, 1);
            }
        }
        else {
            if(PlayerInfo[playerid][pCarLic] < 1 && !IsABike2(vehicleid) && InExamen[playerid] != 1 && GetVehicleModel(vehicleid) != 471) {
                 SCM(playerid,COLOR_GREY, "Nu ai licenta de condus.");
                SlapPlayer(playerid);
                TogglePlayerControllable(playerid, 1);
                SetPlayerFreeze(playerid, 1);
            }
        }
    }
    return true;
}

 

5 answers to this question

Recommended Posts

  • 0
Posted

cand ai compilat ti-a  dat vreo eroare? In caz ca  ti-a dat ceva nu a fost facut bine si de accea nu poti intra.

Te-ai bagat in factiunea respectiva ? Daca nu ceva e facut gresit.

  • 0
Posted

Am adaugat Factiunea in baza de date, am adaugat masiniile din baza de date la factiunea cu nr respectiv, si in GM nu da nici o eroare.

  • 0
Posted

Undeva ai gresit. 

Mai verifica o data daca in baza de date jucatorul are la pMember id factiuni, daca masinile pe care le-ai adaugat au la vFaction id factiuni.

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.