SHARE
TWEET

Poftim

a guest May 25th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. In gamemode cauti if(ServerVehicles[vehicle][vID] != 0 && result == 0), si dupa inlocuiesti tot cu asta:
  2.         if(ServerVehicles[vehicle][vID] != 0 && result == 0) {
  3.             if(vehicle >= 130 && vehicle <= 135) {
  4.                 if(GetPVarInt(playerid, "InLesson") == -1) return SCM(playerid, COLOR_GREY, "Nu ai o lectie activa!"), SlapPlayer(playerid);
  5.             }
  6.             else if(ServerVehicles[vehicle][vFaction] == 1 || ServerVehicles[vehicle][vFaction] == 2 || ServerVehicles[vehicle][vFaction] == 3 || ServerVehicles[vehicle][vFaction] == 14) {
  7.                 if(ServerVehicles[vehicle][vRank] > PlayerInfo[playerid][pRank]) {
  8.                     format(string, sizeof(string), "Ai nevoie de rank %d pentru a lua acest vehicul.", ServerVehicles[vehicle][vRank]);
  9.                     SCM(playerid, COLOR_GREY, string);
  10.                     SlapPlayer(playerid);
  11.                 }
  12.                 else if(OnDuty[playerid] == 0 && IsACop(playerid)) {
  13.                     SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
  14.                     SlapPlayer(playerid);
  15.                     return 1;
  16.                 }
  17.                 else if(!IsACop(playerid)) {
  18.                     format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
  19.                     SCM(playerid, COLOR_GREY, string);
  20.                     SlapPlayer(playerid);              
  21.                 }
  22.             }
  23.             else if(ServerVehicles[vehicle][vFaction] != PlayerInfo[playerid][pMember] && ServerVehicles[vehicle][vFaction] != 0) {
  24.                 format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
  25.                 SCM(playerid, COLOR_GREY, string);
  26.                 SlapPlayer(playerid);
  27.             }
  28.             else {
  29.                 if(OnDuty[playerid] == 0 && IsACop(playerid) && Copcar2(vehicle)) {
  30.                     SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
  31.                     SlapPlayer(playerid);
  32.                     return 1;
  33.                 }          
  34.                 if(ServerVehicles[vehicle][vRank] > PlayerInfo[playerid][pRank]) {
  35.                     format(string, sizeof(string), "Ai nevoie de rank %d pentru a lua acest vehicul.", ServerVehicles[vehicle][vRank]);
  36.                     SCM(playerid, COLOR_GREY, string);
  37.                     SlapPlayer(playerid);
  38.                 }
  39.             }
  40.         }
  41.        
  42.  
  43. Iar acesta este public-ul:
  44. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
  45.     if(!ispassenger) {
  46.         new vehicle = GetVehicleID(vehicleid), string[128];
  47.         if(ServerVehicles[vehicle][vID] != 0 && JobWorking[playerid] == 0) {
  48.             if(vehicle >= 130 && vehicle <= 135) {
  49.                 if(GetPVarInt(playerid, "InLesson") == -1) return SCM(playerid, COLOR_GREY, "Nu ai o lectie activa!"), SlapPlayer(playerid);
  50.             }
  51.             else if(ServerVehicles[vehicle][vFaction] == 1 || ServerVehicles[vehicle][vFaction] == 2 || ServerVehicles[vehicle][vFaction] == 3 || ServerVehicles[vehicle][vFaction] == 14) {
  52.                 if(ServerVehicles[vehicle][vRank] > PlayerInfo[playerid][pRank]) {
  53.                     format(string, sizeof(string), "Ai nevoie de rank %d pentru a lua acest vehicul.", ServerVehicles[vehicle][vRank]);
  54.                     SCM(playerid, COLOR_GREY, string);
  55.                     SlapPlayer(playerid);
  56.                 }
  57.                 else if(OnDuty[playerid] == 0 && IsACop(playerid)) {
  58.                     SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
  59.                     SlapPlayer(playerid);
  60.                     return 1;
  61.                 }
  62.                 else if(!IsACop(playerid)) {
  63.                     format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
  64.                     SCM(playerid, COLOR_GREY, string);
  65.                     SlapPlayer(playerid);
  66.                 }
  67.             }
  68.             else if(ServerVehicles[vehicle][vFaction] != PlayerInfo[playerid][pMember] && ServerVehicles[vehicle][vFaction] != 0) {
  69.                 format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
  70.                 SCM(playerid, COLOR_GREY, string);
  71.                 SlapPlayer(playerid);
  72.             }
  73.             else {
  74.                 if(OnDuty[playerid] == 0 && IsACop(playerid) && Copcar2(vehicle)) {
  75.                     SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
  76.                     SlapPlayer(playerid);
  77.                     return 1;
  78.                 }
  79.             }
  80.         }
  81.         if(IsABoat(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
  82.             if(PlayerInfo[playerid][pBoatLic] < 1 && InDealer[playerid] == 0) {
  83.                 SCM(playerid,COLOR_GREY, "Nu ai licenta de navigatie.");
  84.                 SlapPlayer(playerid);
  85.                 TogglePlayerControllable(playerid, 1);
  86.             }
  87.         }
  88.         else if(IsAPlane(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
  89.             if(PlayerInfo[playerid][pFlyLic] < 1 && InDealer[playerid] == 0) {
  90.                 SCM(playerid, COLOR_GREY, "Nu ai licenta de zbor.");
  91.                 SlapPlayer(playerid);
  92.                 TogglePlayerControllable(playerid, 1);
  93.             }
  94.         }
  95.         else {
  96.             if(PlayerInfo[playerid][pCarLic] < 1) {
  97.                 if(!IsAPlane(vehicleid) || IsABike2(vehicleid) || InExamen[playerid] == 1 || GetVehicleModel(vehicleid) == 471 || InDealer[playerid] > 0) { }
  98.                 else {
  99.                     SCM(playerid,COLOR_GREY, "Nu ai licenta de condus.");
  100.                     SlapPlayer(playerid);
  101.                     TogglePlayerControllable(playerid, 1);
  102.                     SetTimerEx("UnFreezeStation", 500, 0, "i", playerid);
  103.                 }
  104.             }
  105.         }
  106.     }
  107.     return 1;
  108. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top