Jump to content
  • 0
Sign in to follow this  
BereRece

Masini Factiune.

Question

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;
}

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.