Advertisement
ElDubya

Untitled

Sep 20th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.68 KB | None | 0 0
  1. span class="re5"> Put this at the very bottom of your init.sqf :
  2.  
  3.  
  4.  
  5. ServerIllegalRadius = 500;
  6. ServerIllegalRadius2 = 1000;
  7. ServerNoBuildList = ["Land_Mil_ControlTower","Land_SS_hangar","Land_Mil_Barracks_i","Land_Mil_Barracks","Land_budova4_in"];
  8. ServerNoBuildList2 = ["HeliHEmpty"];
  9.  
  10.  
  11.  
  12. Then, go to your player_build_publish.sqf and add this the END of the "private" array at the top :
  13.  
  14.  
  15. ,"_posrad","_cntrad","_cntrad2"
  16.  
  17.  
  18. Then search for this line :
  19.  
  20.  
  21. if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
  22.  
  23.  
  24. Put this directly under it :
  25.  
  26.  
  27. _posrad = [player] call FNC_GetPos;
  28. _cntrad = count (nearestObjects [_posrad, ServerNoBuildList, ServerIllegalRadius]);
  29. _cntrad2 = count (nearestObjects [_posrad, ServerNoBuildList2, ServerIllegalRadius2]);
  30.  
  31.  
  32. if (_cntrad > 0) then {
  33. _cancel = true;
  34. _reason = format["- Building is restricted %1m near military areas", ServerIllegalRadius];
  35. };
  36. if (_cntrad2 > 0) then {
  37. _cancel = true;
  38. _reason = format["- Building is restricted %1m near trader cities", ServerIllegalRadius2];
  39. };
  40.  
  41.  
  42.  
  43. So that it looks like this :
  44.  
  45.     // No building in trader zones
  46.     if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
  47.    
  48.     _posrad = [player] call FNC_GetPos;
  49.     _cntrad = count (nearestObjects [_posrad, ServerNoBuildList, ServerIllegalRadius]);
  50.     _cntrad2 = count (nearestObjects [_posrad, ServerNoBuildList2, ServerIllegalRadius2]);
  51.  
  52.      
  53.     if (_cntrad > 0) then {
  54.     _cancel = true;
  55.     _reason = format["- Building is restricted %1m near military areas!", ServerIllegalRadius];
  56.     };
  57.     if (_cntrad2 > 0) then {
  58.     _cancel = true;
  59.     _reason = format["- Building is restricted %1m near trader areas!", ServerIllegalRadius2];
  60.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement