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;
}
Question
WingsB
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
5 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now