Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(!ispassenger) {
- new vehicle = GetVehicleID(vehicleid), string[256];
- if(ServerVehicles[vehicle][vID] != 0 && JobWorking[playerid] == 0) {
- if(vehicle >= 130 && vehicle <= 135) {
- if(GetPVarInt(playerid, "InLesson") == -1) return SCM(playerid, COLOR_GREY, "Nu ai o lectie activa!"), SlapPlayer(playerid);
- }
- else if(ServerVehicles[vehicle][vFaction] == 1 || ServerVehicles[vehicle][vFaction] == 2 || ServerVehicles[vehicle][vFaction] == 3) {
- 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(OnDuty[playerid] == 0 && IsACop(playerid)) {
- SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
- SlapPlayer(playerid);
- return 1;
- }
- else 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(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 1;
- }
- }
- }
- if(IsABoat(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
- if(PlayerInfo[playerid][pBoatLic] < 1 && InDealer[playerid] == 0) {
- SendClientMessage(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) {
- SendClientMessage(playerid, COLOR_GREY, "Nu ai licenta de zbor.");
- SlapPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- }
- }
- else {
- if(PlayerInfo[playerid][pCarLic] < 1) {
- if(!IsAPlane(vehicleid) || IsABike2(vehicleid) || InExamen[playerid] == 1 || GetVehicleModel(vehicleid) == 471 || InDealer[playerid] > 0) { }
- else {
- SendClientMessage(playerid,COLOR_GREY, "Nu ai licenta de condus.");
- SlapPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- SetTimerEx("UnFreezeStation", 500, 0, "i", playerid);
- }
- }
- }
- }
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement