Advertisement
NanoBob

MI6 training server

Jul 4th, 2013
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 48.56 KB | None | 0 0
  1. admin1="MI-6|NanoBob[SS]"
  2. admin2="MI-6|Ranger[L]"
  3. admin3="MI-6|El_Kebeer[VL]"
  4. admin4="MI-6|NextRom[CoS]"
  5. --admin5=""
  6. --admin6=""
  7. --admin7=""
  8. -- to add an admin remove the "--" before "admin[number]" and write the name behind the =
  9.  
  10. --MI6 base
  11. "  MI.6  ")
  12. copcar2=createVehicle(598,1249,-1823.5,13.2,0,0,0,"  MI.6  ")
  13. copcar3=createVehicle(598,1254.5,-1823.5,13.2,0,0,0,"  MI.6  ")
  14. copcar4=createVehicle(598,1259.59998,-1823.5,13.2,0,0,0,"  MI.6  ")
  15. sgt=createVehicle(506,1265.30005,-1822.5,13.2,0,0,0,"  MI.6  ")
  16. huntley=createVehicle(579,1269.30005,-1822.5,13.2,0,0,0,"  MI.6  ")
  17. beagle=createVehicle(511,1194.59998,-1799.90002,35.4,0,0,-90)
  18. maverick1=createVehicle(497,1264,-1789,33.71,0,0,90)
  19. maverick2=createVehicle(497,1264,-1748,33.71,0,0,90)
  20. setVehicleColor(copcar1,240,240,240,240,240,240)
  21. setVehicleColor(copcar2,240,240,240,240,240,240)
  22. setVehicleColor(copcar3,240,240,240,240,240,240)
  23. setVehicleColor(copcar4,240,240,240,240,240,240)
  24. setVehicleColor(sgt,240,240,240,240,240,240)
  25. setVehicleColor(huntley,240,240,240,240,240,240)
  26. setVehicleColor(beagle,240,240,240,240,240,240)
  27. setVehicleColor(maverick1,240,240,240,240,240,240)
  28. setVehicleColor(maverick2,240,240,240,240,240,240)
  29.  
  30. end
  31.  
  32. function respawnvehs(source)
  33. sourcename=getPlayerNametagText(source)
  34.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  35.     destroyElement(copcar1)
  36.     destroyElement(copcar2)
  37.     destroyElement(copcar3)
  38.     destroyElement(copcar4)
  39.     destroyElement(sgt)
  40.     destroyElement(huntley)
  41.     destroyElement(beagle)
  42.     destroyElement(maverick1)
  43.     destroyElement(maverick2)
  44.     setTimer(vehcreate,1000,1)
  45.     end
  46. end
  47.  
  48.  
  49. addCommandHandler("respawnvehicles",respawnvehs)
  50.  
  51. gate1=createObject(980,1172.2,-1805.3,15.2,0,0,0)
  52. gate2=createObject(980,1183.9,-1787.8000488281,15.2)
  53. weaponlockerdoor=createObject(2634,1317.1999511719,-1825.4000244141,-99)
  54. marker1=createMarker(1219,-1812.2,17.60000038147,"arrow",2)
  55. marker2=createMarker(1237,-1783.7,34.9,"arrow",2)
  56. marker3=createMarker(1211,-1750,15.6,"arrow",2)
  57. marker4=createMarker(1296.3000488281,-1783.1999511719,-67.699996948242,"arrow",2)
  58. gate1col=createColSphere(1172.2,-1805.3,15.2,8)
  59. gate2col=createColSphere(1183.9,-1787.8000488281,15.2,8)
  60. marker1col=createColSphere(1219,-1812.2,16.60000038147,1)
  61. marker2col=createColSphere(1237,-1783.7,33.9,1)
  62. marker3col=createColSphere(1211,-1750,13.1,1)
  63. marker4col=createColSphere(1296.3000488281,-1783.1999511719,-69.699996948242,1)
  64. paramarker=createMarker(1247.9398193359,-1772.3311767578,32.651016235352,"cylinder",2,0,153,255)
  65. paramarkercol=createColSphere(1247.9398193359,-1772.3311767578,33.651016235352,2)
  66. intgate=createObject(2930,1209.3,-1750.1,15.,0,0,44.9)
  67. heligate=createObject(2930,1232.4,-1786.9,35.3,0,0,90)
  68. frontgate=createObject(2930,1195.64,-1747.25,15.1)
  69. intgatecol=createColSphere(1209.3,-1750.1,15,3)
  70. heligatecol=createColSphere(1232.4,-1786.9,35.3,3)
  71. frontgatecol=createColSphere(1195.64,-1747.25,15.1,3)
  72. killmarker=createMarker(-383.15,2304.33,35.12,"cylinder",2,0,0,0)
  73. killmarkercol=createColSphere(-383.15,2304.33,36.12,2)
  74.  
  75.  
  76. function killfunction()
  77. explosionx,explosiony,explosionz=getElementPosition(source)
  78. createExplosion(explosionx,explosiony,explosionz,10)
  79. createExplosion(explosionx,explosiony,explosionz,10)
  80. createExplosion(explosionx,explosiony,explosionz,10)
  81. end
  82.  
  83. addEventHandler("onColShapeHit",killmarkercol,killfunction)
  84.  
  85. keypad1=createColSphere(1320.0999755859,-1825.4000244141,-98.7,2)
  86. keypad2=createColSphere(1318.9000244141,-1826,-98.69999694824,2)
  87. setElementDoubleSided(gate1,true)
  88. setElementDoubleSided(gate2,true)
  89.  
  90. function openintgate()
  91. moveObject(intgate,1000,1209.3,-1750.1,12.6)
  92. end
  93.  
  94. function closeintgate()
  95. moveObject(intgate,1000,1209.3,-1750.1,15)
  96. end
  97.  
  98. function openfrontgate()
  99. moveObject(frontgate,1000,1195.64,-1748.75,15.1)
  100. end
  101.  
  102. function closefrontgate()
  103. moveObject(frontgate,1000,1195.64,-1747.25,15.1)
  104. end
  105.  
  106. function opengate1()
  107. moveObject(gate1,1000,1172.2,-1805.3,20.2)
  108. end
  109.  
  110. function closegate1()
  111. moveObject(gate1,5000,1172.2,-1805.3,15.2)
  112. end
  113.  
  114. function opengate2()
  115. moveObject(gate2,1000,1183.9,-1787.8000488281,20.2)
  116. end
  117.  
  118. function closegate2()
  119. moveObject(gate2,5000,1183.9,-1787.8000488281,15.2)
  120. end
  121.  
  122. function openheligate()
  123. moveObject(heligate,1000,1232.4,-1786.9,37.8)
  124. end
  125.  
  126. function closeheligate()
  127. moveObject(heligate,1000,1232.4,-1786.9,35.3)
  128. end
  129.  
  130. function marker1go(source)
  131. setTimer(function()setElementPosition(source,1237,-1786,33.9)end,1050,1)
  132.  
  133. setTimer(fadeblack,50,1,source)
  134. end
  135.  
  136. function marker2go(source)
  137. setTimer(function()setElementPosition(source,1223,-1812.2,16.60000038147)end,1050,1)
  138.  
  139. setTimer(fadeblack,50,1,source)
  140. end
  141.  
  142. function marker3go(source)
  143. setTimer(function()setElementPosition(source,1292.3000488281,-1783.1999511719,-69.699996948242)end,1050,1)
  144.  
  145. setTimer(fadeblack,50,1,source)
  146. end
  147.  
  148. function marker4go(source)
  149. setTimer(function()setElementPosition(source,1209,-1751,13.6)end,1050,1)
  150.  
  151. setTimer(fadeblack,50,1,source)
  152. end
  153.  
  154. function weaponlockerdooropen()
  155. moveObject(weaponlockerdoor,10000,1316.3000488281,-1824.4000244141,-99,0,0,45)
  156. setTimer(weaponlockerdoorclose,20000,1)
  157. end
  158.  
  159. function weaponlockerdoorclose()
  160. moveObject(weaponlockerdoor,10000,1317.1999511719,-1825.4000244141,-99,0,0,-45)
  161. end
  162.  
  163.  
  164. addEventHandler("onColShapeHit",intgatecol,openintgate)
  165. addEventHandler("onColShapeHit",heligatecol,openheligate)
  166. addEventHandler("onColShapeHit",frontgatecol,openfrontgate)
  167. addEventHandler("onColShapeLeave",intgatecol,closeintgate)
  168. addEventHandler("onColShapeLeave",heligatecol,closeheligate)
  169. addEventHandler("onColShapeLeave",frontgatecol,closefrontgate)
  170. addEventHandler("onColShapeHit",marker1col,marker1go)
  171. addEventHandler("onColShapeHit",marker2col,marker2go)
  172. addEventHandler("onColShapeHit",marker3col,marker3go)
  173. addEventHandler("onColShapeHit",marker4col,marker4go)
  174. addEventHandler("onColShapeHit",keypad1,weaponlockerdooropen)
  175. addEventHandler("onColShapeHit",keypad2,weaponlockerdooropen)
  176. addEventHandler("onColShapeHit",gate1col,opengate1)
  177. addEventHandler("onColShapeHit",gate2col,opengate2)
  178. addEventHandler("onColShapeLeave",gate1col,closegate1)
  179. addEventHandler("onColShapeLeave",gate2col,closegate2)
  180. addCommandHandler("noobbase",creation)
  181.  
  182.  
  183. -- /MI6 base
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. -- nocloud
  194.  
  195. function clouds()
  196. setCloudsEnabled(false)
  197.  
  198.  
  199.  
  200. end
  201.  
  202. addEventHandler ("onResourceStart",getRootElement(),clouds)
  203.  
  204. -- /nocloud
  205.  
  206.  
  207.  
  208.  
  209. -- weapons
  210.  
  211. -- no minigun
  212. function checkweap(previousWeaponID,currentWeaponID,weapon)
  213.     if currentWeaponID==38  then
  214.         takeWeapon(source,38)
  215.         outputChatBox("#ff0000 NO MINIGUN!",source,0,0,0,true)
  216.    
  217.  
  218.     end
  219.  
  220.  
  221.  
  222. end
  223.  
  224. function checkweapfired(weapon,ammo,ammoInClip,hitX, hitY, hitZ,hitElement,firerer)
  225.     if weapon==38 then
  226.         takeWeapon(source,38)
  227.         outputChatBox("#ff0000 NO MINIGUN!",source,0,0,0,true)
  228.     end
  229.    
  230.  
  231. end
  232.  
  233.  
  234.  
  235. function shotgunslow(hitElement,firerer)
  236.     if getElementType(hitElement)=="player" and shotgunenable~="false" then
  237.         shotgunenable="false"
  238.         setTimer(function()
  239.                     shotgunenable="true"
  240.                     end
  241.                     ,5000,1)
  242.         if (getPlayerTeam(firerer) == cop) and (getPlayerTeam(hitElement) == crim) then
  243.             outputChatBox("You have succesfully hit a criminal with rubber bullets",firerer,200,200,200)
  244.             outputChatBox("You were hit by rubber bullets, you are hurt for 4 seconds",hitElement,200,200,200)
  245.             toggleControl(hitElement,"sprint",false)
  246.             setTimer(function()
  247.                                     toggleControl(hitElement,"sprint",true)
  248.                                 end
  249.                                 ,4000,1)
  250.  
  251.         end
  252.     end
  253. end
  254.  
  255.  
  256. addEvent("shotgunfire",true)
  257. addEventHandler("shotgunfire",getRootElement(),shotgunslow)
  258.  
  259. addEvent("checkweaponfired",true)
  260. addEventHandler("checkweaponfired",getRootElement(),checkweapfired)
  261.  
  262. addEventHandler("onPlayerWeaponSwitch",getRootElement(),checkweap)
  263. -- /no minigun
  264.  
  265.  
  266. --explosive M4
  267. function M4createexplosion(hitX,hitY,hitZ)
  268. createExplosion(hitX,hitY,hitZ,12)
  269. laserfire="yes"
  270. setTimer(function()
  271.     laserfire="no"
  272.     end,1000,1,1)
  273.  
  274. end
  275.  
  276.  
  277.  
  278. addEvent("M4explosion",true)
  279. addEventHandler("M4explosion",getRootElement(),M4createexplosion)
  280.  
  281.  
  282. function M4createexplosionOP(hitX,hitY,hitZ,shooter,gun)
  283. createExplosion(hitX,hitY,hitZ,7)
  284. createExplosion(hitX,hitY,hitZ,7)
  285. createExplosion(hitX,hitY,hitZ,7)
  286. setWeaponAmmo(shooter,31,15000,ammoInClip+1)
  287. end
  288. addEvent("M4explosionOP",true)
  289. addEventHandler("M4explosionOP",getRootElement(),M4createexplosion)
  290.  
  291. function takeawaynade(creator)
  292. takeWeapon(creator,16)
  293. if messageenabled~="no" then
  294.  
  295. outputChatBox("you can throw another nade in 10 seconds!",creator)
  296. messageenabled="no"
  297. setTimer(function() messageenabled="yes" end ,500,1)
  298. end
  299.  
  300. setTimer(function() giveWeapon(creator,16,666) end ,10000,1)
  301.  
  302.  
  303.  
  304. end
  305.  
  306. addEvent("removenades",true)
  307. addEventHandler("removenades",getRootElement(),takeawaynade)
  308. -- /explosive M4
  309. -- /weapons
  310.  
  311.  
  312.  
  313.  
  314.  
  315. -- spawn
  316. function wait()
  317. setTimer(spawn,5000,1,source)
  318. setTimer(fadeblack,4050,1,source)
  319. end
  320.  
  321. function spawn(source)
  322.     spawnPlayer(source,1222,-1814,16.59)
  323.     setPlayerTeam(source,MI6)
  324.     fadeCamera(source,true)
  325.     setCameraTarget(source,source)
  326.     player=source
  327.     setTimer(skin,50,1,player)
  328.  
  329. end
  330.  
  331.  
  332.  
  333.  
  334.  
  335. function skin(player)
  336. setElementInterior(player,0)
  337. setElementModel(player,163)
  338. createBlipAttachedTo (player,0, 2,0,153,255)
  339. setPlayerBlurLevel(player,0)
  340. end
  341.  
  342. -- team()
  343. MI6=createTeam("MI6",0,153,255)
  344. crim=createTeam("crim",255,0,0)
  345. cop=createTeam("cop",0,0,255)
  346. redGT=createTeam("redGT",255,0,0)
  347. blueGT=createTeam("blueGT",0,0,255)
  348. -- end
  349.  
  350. function welcome()
  351.     spawnPlayer(source,1222,-1814,16.59)
  352.     setPlayerBlurLevel(source,0)
  353.     setPlayerTeam(source,MI6)
  354.     outputChatBox("#f0f0f0Welcome to the#0099ff MI6 #f0f0f0training server", source,255,255,255,true)
  355.     outputChatBox("scripts by NanoBob", source,255,255,255,true)
  356.     setElementModel(source,163)
  357.     createBlipAttachedTo (source,0, 2,0,153,255)
  358.     fadeCamera(source,true)
  359.     setCameraTarget(source,source)
  360.     setPlayerTeam(source,MI6)
  361.     setPlayerNametagColor(source,false)
  362.     bindKey(source,"r","down","reload")
  363.     fadeCamera(source,false,0)
  364.     triggerClientEvent(source,"joint",getRootElement())
  365. end
  366.  
  367. addEventHandler("onPlayerJoin",getRootElement(),welcome)
  368. addEventHandler("onPlayerWasted",getRootElement(),wait)
  369. -- /spawn
  370.  
  371.  
  372.  
  373.  
  374. -- Para test
  375. function win(source)
  376. name=getPlayerNametagText(source)
  377. outputChatBox(name.." landed on 35")
  378. end
  379.  
  380. function middlecolmaker()
  381. middlecol=createColSphere(1245.4825,-1762.848266,33.6486,0.7)
  382. addEventHandler("onColShapeHit",middlecol,win)
  383. end
  384.  
  385. function startparatest(source)
  386. sourcename=getPlayerNametagText(source)
  387.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  388.  
  389. allyoarses=getElementsByType( "player" )
  390.     outputChatBox("Parachuting test started")
  391.     for theKey,thePlayer in ipairs(allyoarses) do
  392.     setElementPosition(thePlayer,1265.0999755859,-1691.5999755859,1030)
  393.     giveWeapon(thePlayer,46,1,true)
  394.  
  395.     end
  396.     end
  397. end
  398.  
  399.  
  400. addCommandHandler("paratest",startparatest)
  401.  
  402. function markerparatest(source)
  403.    
  404.     thePlayer=source
  405.     setTimer(function()setElementPosition(thePlayer,1265.0999755859,-1691.5999755859,1030)
  406.     giveWeapon(thePlayer,46,1,true)end,1050,1)
  407.     setTimer(fadeblack,50,1,source)
  408. end
  409. addEventHandler("onColShapeHit",paramarkercol,markerparatest)
  410. addCommandHandler("wincol",middlecolmaker)
  411.  
  412.  
  413.  
  414. -- /Para test
  415.  
  416.  
  417.  
  418. -- extra
  419.  
  420. function carlock(source)
  421.     vehfromplayer=getPedOccupiedVehicle(source)
  422.     locked=isVehicleLocked(vehfromplayer)
  423.  
  424.     if locked then
  425.         setVehicleLocked(vehfromplayer,false)
  426.         outputChatBox("Unlocked your vehicle",source,0,255,0)
  427.     else
  428.         setVehicleLocked(vehfromplayer,true)
  429.         outputChatBox("locked your vehicle",source,0,255,0)
  430.     end
  431. end
  432. addCommandHandler("lock",carlock)
  433.  
  434.  
  435.  
  436.  
  437.  
  438. function countdown(player,command,arg1)
  439.     number=arg1
  440.    
  441.     function compare(nubmer)
  442.         if number ~= 0 then
  443.             outputChatBox(number)
  444.             number=number-1
  445.             setTimer(compare,1000,1,number)
  446.         elseif number==0 then
  447.             outputChatBox("go!")
  448.             number=nil
  449.             removeEventHandler("runf1",getRootElement(),compare)
  450.         end
  451.     end
  452.    
  453.     addEvent("runf1",false)
  454.     addEventHandler("runf1",getRootElement(),compare)
  455.     triggerEvent("runf1",getRootElement())
  456.    
  457. end
  458.  
  459. addCommandHandler("countdown",countdown)
  460.  
  461. function reloadfunc(source)
  462. reloadPedWeapon(source)
  463.     unbindKey(source,"r","down","reload")
  464.     bindKey(source,"r","down","reload")
  465. end
  466.  
  467. addCommandHandler("reload",reloadfunc)
  468.  
  469.  
  470.  
  471. function dfunc()
  472.     destroyElement(getRootElement())
  473. end
  474.  
  475. addCommandHandler("destroy",dfunc)
  476.  
  477. -- arrest stuff
  478. function crimskin(source)
  479. crimskinnum=math.random(19,23)
  480. setElementModel(source,crimskinnum)
  481. whichshotgunuwant=math.random(26,27)
  482. giveWeapon(source,whichshotgunuwant,9000)
  483. giveWeapon(source,28,9000)
  484. giveWeapon(source,31,9000)
  485. giveWeapon(source,16,666)
  486. giveWeapon(source,24,9000)
  487. giveWeapon(source,34,2500)
  488. giveWeapon(source,46,1)
  489. setPlayerTeam(source,crim)
  490. createBlipAttachedTo (source,0, 2,255,0,0)
  491. outputChatBox(" Do not move. Only start moving on 3 in the countdown.",source,200,200,200)
  492. outputChatBox(" Only start shooting after [go]",source,200,200,200)
  493.  
  494.     if setcoords=="false" then
  495.         setElementPosition(source,tpx,tpy,tpz)
  496.     elseif setcoords~="false" then
  497.         setcoords="false"
  498.         setTimer(function() setcoords="true" end ,30000,1)
  499.         whichcoords=math.random(1,12)
  500.         if whichcoords== 1 then
  501.             tpx,tpy,tpz=1920,-1203,19.9
  502.             setElementPosition(source,tpx,tpy,tpz)
  503.         elseif whichcoords== 2 then
  504.             tpx,tpy,tpz=2167,-981,75.3
  505.             setElementPosition(source,tpx,tpy,tpz)
  506.         elseif whichcoords== 3 then
  507.             tpx,tpy,tpz=2604,-1209,65
  508.             setElementPosition(source,tpx,tpy,tpz)
  509.         elseif whichcoords== 4 then
  510.             tpx,tpy,tpz=2770,-1508,39.7
  511.             setElementPosition(source,tpx,tpy,tpz)
  512.         elseif whichcoords== 5 then
  513.             tpx,tpy,tpz=1111,1646,5.82
  514.             setElementPosition(source,tpx,tpy,tpz)
  515.         elseif whichcoords== 6 then
  516.             tpx,tpy,tpz=-2328,-1634,483.7
  517.             setElementPosition(source,tpx,tpy,tpz)
  518.         elseif whichcoords== 7 then
  519.             tpx,tpy,tpz=-2681,1770,68.4
  520.             setElementPosition(source,tpx,tpy,tpz)
  521.         elseif whichcoords== 8 then
  522.             tpx,tpy,tpz=-2429,1265,35.4
  523.             setElementPosition(source,tpx,tpy,tpz)
  524.         elseif whichcoords== 9 then
  525.             tpx,tpy,tpz=-1922,1000,35
  526.             setElementPosition(source,tpx,tpy,tpz)
  527.         elseif whichcoords== 10 then
  528.             tpx,tpy,tpz=1076,2317,10.8
  529.             setElementPosition(source,tpx,tpy,tpz)
  530.         elseif whichcoords== 11 then
  531.             tpx,tpy,tpz=2346,-2005,13.5
  532.             setElementPosition(source,tpx,tpy,tpz)
  533.         elseif whichcoords== 12 then
  534.             tpx,tpy,tpz=1542,-1353,329 
  535.             setElementPosition(source,tpx,tpy,tpz)
  536.         end
  537.        
  538.     end
  539. end
  540.  
  541. function copskin(source)
  542. copskinnum=math.random(280,286)
  543. setElementModel(source,copskinnum)
  544. createBlipAttachedTo (source,0, 2,0,0,255)
  545. outputChatBox(" Do not move. Only start moving on [Go] after the countdown.",source,200,200,200)
  546. giveWeapon(source,25,15000)
  547. giveWeapon(source,41,5000)
  548. giveWeapon(source,46,1)
  549.  
  550.     if setcoords=="false" then
  551.         setElementPosition(source,tpx,tpy,tpz)
  552.     elseif setcoords~="false" then
  553.         setcoords="false"
  554.         setTimer(function() setcoords="true" end ,30000,1)
  555.         whichcoords=math.random(1,12)
  556.         if whichcoords== 1 then
  557.             tpx,tpy,tpz=1920,-1203,19.9
  558.             setElementPosition(source,tpx,tpy,tpz)
  559.         elseif whichcoords== 2 then
  560.             tpx,tpy,tpz=2167,-981,75.3
  561.             setElementPosition(source,tpx,tpy,tpz)
  562.         elseif whichcoords== 3 then
  563.             tpx,tpy,tpz=2604,-1209,65
  564.             setElementPosition(source,tpx,tpy,tpz)
  565.         elseif whichcoords== 4 then
  566.             tpx,tpy,tpz=2770,-1508,39.7
  567.             setElementPosition(source,tpx,tpy,tpz)
  568.         elseif whichcoords== 5 then
  569.             tpx,tpy,tpz=1111,1646,5.82
  570.             setElementPosition(source,tpx,tpy,tpz)
  571.         elseif whichcoords== 6 then
  572.             tpx,tpy,tpz=-2328,-1634,483.7
  573.             setElementPosition(source,tpx,tpy,tpz)
  574.         elseif whichcoords== 7 then
  575.             tpx,tpy,tpz=-2681,1770,68.4
  576.             setElementPosition(source,tpx,tpy,tpz)
  577.         elseif whichcoords== 8 then
  578.             tpx,tpy,tpz=-2429,1265,35.4
  579.             setElementPosition(source,tpx,tpy,tpz)
  580.         elseif whichcoords== 9 then
  581.             tpx,tpy,tpz=-1922,1000,35
  582.             setElementPosition(source,tpx,tpy,tpz)
  583.         elseif whichcoords== 10 then
  584.             tpx,tpy,tpz=1076,2317,10.8
  585.             setElementPosition(source,tpx,tpy,tpz)
  586.         elseif whichcoords== 11 then
  587.             tpx,tpy,tpz=2346,-2005,13.5
  588.             setElementPosition(source,tpx,tpy,tpz)
  589.         elseif whichcoords== 12 then
  590.             tpx,tpy,tpz=1542,-1353,329 
  591.             setElementPosition(source,tpx,tpy,tpz)
  592.         end
  593.        
  594.     end
  595. end
  596.  
  597.  
  598.  
  599.  
  600. function tpcrim(source)
  601. takeAllWeapons(source)
  602. crimplayer=getPlayerNametagText(source)
  603. outputChatBox("#ff0000"..crimplayer.."#f0f0f0 Joined the #ff0000criminals",getRootElement(),0,0,0,true)
  604. setPlayerTeam(source,crim)
  605. setTimer(fadeblack,50,1,source)
  606. setTimer(crimskin,1050,1,source)
  607. end
  608.  
  609.  
  610.  
  611. function tpcop(source)
  612. takeAllWeapons(source)
  613. copplayer=getPlayerNametagText(source)
  614. outputChatBox("#0000ff"..copplayer.."#f0f0f0 Joined the #0000ffcops",getRootElement(),0,0,0,true)
  615. setPlayerTeam(source,cop)
  616. giveWeapon(source,23,500)
  617. giveWeapon(source,3,1)
  618. setTimer(fadeblack,50,1,source)
  619. setTimer(copskin,1050,1,source)
  620.  
  621.  
  622.  
  623.  
  624. end
  625.  
  626.  
  627.     createMarker(1276.21,-1787.29,12.7,"cylinder",2,0,0,255)
  628.     createMarker(1270.24,-1787.29,12.7,"cylinder",2,255,0,0)
  629.     crimcolsphere=createColSphere(1270.24,-1787.29,12.7,2)
  630.     copcolsphere=createColSphere(1276.21,-1787.29,12.7,2)
  631.     addEventHandler("onColShapeHit",crimcolsphere,tpcrim)
  632.     addEventHandler("onColShapeHit",copcolsphere,tpcop)
  633.  
  634.  
  635.  
  636.     function meeleearrester(attacker,hitted)
  637.  
  638.         if (hitted ~= nil) then
  639.  
  640.             if getElementType ( hitted ) == "player" then
  641.  
  642.                     if (getPlayerTeam(hitted) == crim) then
  643.  
  644.                         if (getPlayerTeam(attacker) == cop) then
  645.                         arrester=getPlayerNametagText(attacker)
  646.                         arrested=getPlayerNametagText(hitted)
  647.                             willIarrest=math.random(1,2)
  648.                             if willIarrest==2 then
  649.                                 if arrestmessageenabled~="no" then
  650.                                 outputChatBox("#ff0000"..arrested.."#f0f0f0 has been arrested by #0000ff"..arrester,getRootElement(),255,255,255,true)
  651.                                 messageenabled="no"
  652.                                 setPlayerTeam(hitted,MI6)
  653.                                 setElementModel(hitted,163)
  654.                                 takeAllWeapons(hitted)
  655.                                 setElementHealth(hitted,100)
  656.                                 createBlipAttachedTo (hitted,0, 2,0,153,255)
  657.                                 setTimer(function() arrestmessageenabled="yes" end ,500,1)
  658.                                 end
  659.                         setElementPosition(hitted,1283.66,-1838.588,13.72)
  660.                             end
  661.                         end
  662.                     end
  663.                
  664.             end
  665.  
  666.         end
  667.  
  668.     end
  669.     addEvent("meeleearrest",true)
  670.     addEventHandler("meeleearrest",getRootElement(),meeleearrester)
  671.    
  672.    
  673.    
  674.    
  675.    
  676.    
  677.    
  678.         function stickarrester(attacker,hitted)
  679.  
  680.         if (hitted ~= nil) then
  681.  
  682.             if getElementType ( hitted ) == "player" then
  683.  
  684.                     if (getPlayerTeam(hitted) == crim) then
  685.  
  686.                         if (getPlayerTeam(attacker) == cop) then
  687.                         willIarrest=math.random(1,5)
  688.                             if willIarrest==2 then
  689.                                 arrester=getPlayerNametagText(attacker)
  690.                                 arrested=getPlayerNametagText(hitted)
  691.                                
  692.                                 if arrestmessageenabled~="no" then
  693.                                 outputChatBox("#ff0000"..arrested.."#f0f0f0 has been arrested by #0000ff"..arrester,getRootElement(),255,255,255,true)
  694.                                 messageenabled="no"
  695.                                 setPlayerTeam(hitted,MI6)
  696.                                 setElementModel(hitted,163)
  697.                                 takeAllWeapons(hitted)
  698.                                 setElementHealth(hitted,100)
  699.                                 createBlipAttachedTo (hitted,0, 2,0,153,255)
  700.                                 setTimer(function() arrestmessageenabled="yes" end ,500,1)
  701.                                 end
  702.                                 setElementPosition(hitted,1283.66,-1838.588,13.72)
  703.                             end
  704.                         end
  705.                     end
  706.                
  707.             end
  708.  
  709.         end
  710.  
  711.     end
  712.    
  713.    
  714.     addEvent("stickarrest",true)
  715.     addEventHandler("stickarrest",getRootElement(),stickarrester)
  716.    
  717.     -- /arrest stuff
  718.  
  719.  
  720. -- Gt warps
  721.     function redskin(source)
  722.         takeAllWeapons(source)
  723.         setElementPosition(source,-424.05,2240.87,42.42)
  724.         setPlayerTeam(source,redGT)
  725.         setElementModel(source,167)
  726.         giveWeapon(source,31,9000)
  727.         createBlipAttachedTo (source,0, 2,255,0,0)
  728.         outputChatBox("Take your position. Only start shooting at the countdown. Listen to the top ranked MI6 member to know the rules for this match.",source,200,200,200)
  729.     end
  730.    
  731.     function blueskin(source)
  732.         takeAllWeapons(source)
  733.         setElementPosition(source,-360.18,2246.64,42.48)
  734.         setPlayerTeam(source,blueGT)
  735.         setElementModel(source,287)
  736.         giveWeapon(source,31,9000)
  737.         createBlipAttachedTo (source,0, 2,0,0,255)
  738.         outputChatBox("Take your position. Only start shooting at the countdown. Listen to the top ranked MI6 member to know the rules for this match.",source,200,200,200)
  739.     end
  740.     function tpredGT(source)
  741.     giveWeapon(source,31,4000)
  742.     setTimer(fadeblack,50,1,source)
  743.     setTimer(redskin,1050,1,source)
  744.     end
  745.    
  746.  
  747.    
  748.     function tpblueGT(source)
  749.     giveWeapon(source,31,4000)
  750.     setTimer(fadeblack,50,1,source)
  751.     setTimer(blueskin,1050,1,source)
  752.  
  753.    
  754.     end
  755.  
  756.  
  757.     createMarker(1261.41,-1790.97,12.7,"cylinder",2,255,0,0)
  758.     createMarker(1265.70,-1790.97,12.7,"cylinder",2,0,0,255)
  759.     redGTcol=createColSphere(1261.38,-1790.97,13.40,2)
  760.     blueGTcol=createColSphere(1265.70,-1790.97,13.40,2)
  761.     addEventHandler("onColShapeHit",redGTcol,tpredGT)
  762.     addEventHandler("onColShapeHit",blueGTcol,tpblueGT)
  763.  
  764. -- /Gt warps
  765. function fadeblack(source)
  766. fadeCamera(source,false,1,0,0,0)
  767. setTimer(fadeback,1000,1,source)
  768.  
  769. end
  770.  
  771. function fadeback(source)
  772. fadeCamera(source,true,2)
  773.  
  774. end
  775.  
  776. function regroup(source)
  777. sourcename=getPlayerNametagText(source)
  778.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  779.     allyoarses=getElementsByType( "player" )
  780.     outputChatBox("Regrouped players!")
  781.     for theKey,thePlayer in ipairs(allyoarses) do
  782.         setElementHealth(thePlayer,100)
  783.         takeAllWeapons(thePlayer)
  784.         setElementModel(thePlayer,163)
  785.         setPlayerTeam(thePlayer,MI6)
  786.         setElementPosition(thePlayer,1213.06,-1840.27,13.38)
  787.         createBlipAttachedTo (thePlayer,0, 2,0,153,255)
  788.     end
  789.     end
  790. end
  791. addCommandHandler("regroup",regroup)
  792.  
  793. --settings
  794. setWeaponProperty(23,"std","maximum_clip_ammo",1)
  795. setWeaponProperty(23,"pro","maximum_clip_ammo",1)
  796. setWeaponProperty(23,"poor","maximum_clip_ammo",1)
  797. setWeaponProperty(23,"std","damage",1)
  798. setWeaponProperty(23,"pro","damage",1)
  799. setWeaponProperty(23,"poor","damage",1)
  800. setWeaponProperty(23,"std","weapon_range",5)
  801. setWeaponProperty(23,"pro","weapon_range",5)
  802. setWeaponProperty(23,"poor","weapon_range",5)
  803. setWeaponProperty(25,"pro","damage",1)
  804. --settings
  805.  
  806.     function ped (source)
  807.     pedid=math.random(1,299)
  808.     px,py,pz=getElementPosition(source)
  809.     createPed(pedid,px,py-8,pz)
  810.     end
  811.    
  812. addCommandHandler("ped", ped)
  813.  
  814.  
  815. -- blips stuff
  816. function onPlayerQuit ()
  817.     destroyBlipsAttachedTo ( source )
  818. end
  819.  
  820. function onPlayerWasted ( totalammo, killer, killerweapon )
  821.     destroyBlipsAttachedTo ( source )
  822. end
  823.  
  824.  
  825. addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted )
  826. addEventHandler ( "onPlayerQuit", getRootElement(), onPlayerQuit )
  827.  
  828.  
  829.  
  830. function removeblips(source)
  831.  
  832.     sourcename=getPlayerNametagText(source)
  833.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  834.     allplayers=getElementsByType( "player" )
  835.     for theKey,player in ipairs(allplayers) do
  836.     destroyBlipsAttachedTo(player)
  837.     end
  838.     end
  839. end
  840.  
  841.  
  842.  
  843. addCommandHandler("blip",removeblips)
  844.  
  845. function destroyBlipsAttachedTo(player)
  846.  
  847.     local attached = getAttachedElements ( player )
  848.     if ( attached ) then
  849.         for k,element in ipairs(attached) do
  850.             if getElementType ( element ) == "blip" then
  851.                 destroyElement ( element )
  852.             end
  853.         end
  854.     end
  855. end
  856.  
  857.  
  858. function copcarmaker(source)
  859. sourcename=getPlayerNametagText(source)
  860.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  861.         carx,cary,carz=getElementPosition(source)
  862.         rot1,rot2,rot3=getElementRotation(source)
  863.         copcar=createVehicle(596,carx,cary,carz,rot1,rot2,rot3,"  MI.6  ")
  864.         warpPedIntoVehicle(source,copcar)
  865.  
  866.  
  867.     setVehicleHandling(copcar,"maxVeolocity",205)
  868.     setVehicleHandling(copcar,"numberOfGears",5)
  869.     setVehicleHandling(copcar,"driveType","awd")
  870.     setVehicleHandling(copcar,"engineType",petrol)
  871.     setVehicleHandling(copcar,"engineAcceleration",19)
  872.     setVehicleHandling(copcar,"brakeBias",0.9)
  873.     end
  874. end
  875.  
  876. function crimcarmaker(source)
  877. sourcename=getPlayerNametagText(source)
  878.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  879.         carx,cary,carz=getElementPosition(source)
  880.         rot1,rot2,rot3=getElementRotation(source)  
  881.     crimcar=createVehicle(560,carx,cary,carz,rot1,rot2,rot3,"criminal")
  882.     warpPedIntoVehicle(source,crimcar)
  883.     setVehicleHandling(crimcar,"maxVeolocity",205)
  884.     setVehicleHandling(crimcar,"numberOfGears",5)
  885.     setVehicleHandling(crimcar,"driveType","awd")
  886.     setVehicleHandling(crimcar,"engineType",petrol)
  887.     setVehicleHandling(crimcar,"engineAcceleration",21)
  888.     setVehicleHandling(crimcar,"brakeBias",0.9)
  889.     end
  890.        
  891. end    
  892.  
  893. function criminalcarmaker(source)
  894. sourcename=getPlayerNametagText(source)
  895.     if sourcename==admin1 or sourcename==admin2 or sourcename==admin3 or sourcename==admin4 or sourcename==admin5 or sourcename==admin6 then
  896.         carx,cary,carz=getElementPosition(source)
  897.         rot1,rot2,rot3=getElementRotation(source)  
  898.     criminalcar=createVehicle(560,carx,cary,carz,rot1,rot2,rot3,"criminal")
  899.     warpPedIntoVehile(source,criminalcar)
  900.     setVehicleHandling(criminalcar,"maxVeolocity",205)
  901.     setVehicleHandling(criminalcar,"numberOfGears",5)
  902.     setVehicleHandling(criminalcar,"driveType","awd")
  903.     setVehicleHandling(criminalcar,"engineType",petrol)
  904.     setVehicleHandling(criminalcar,"engineAcceleration",21)
  905.     setVehicleHandling(criminalcar,"brakeBias",0.9)
  906.     end
  907.        
  908. end    
  909.  
  910. function policecarmaker(source)
  911.  
  912.         carx,cary,carz=getElementPosition(source)
  913.         rot1,rot2,rot3=getElementRotation(source)
  914.         policeveh=createVehicle(596,carx,cary,carz,rot1,rot2,rot3,"  MI.6  ")
  915.  
  916.  
  917. setVehicleHandling(policeveh,"maxVelocity",205)
  918. setVehicleHandling(policeveh,"numberOfGears",5)
  919. setVehicleHandling(policeveh,"driveType","awd")
  920. setVehicleHandling(policeveh,"engineType",petrol)
  921. setVehicleHandling(policeveh,"engineAcceleration",19)
  922. setVehicleHandling(policeveh,"brakeBias",0.9)
  923.  
  924. end
  925. addCommandHandler("criminalcar",criminalcarmaker)
  926. addCommandHandler("crimcar",crimcarmaker)
  927. addCommandHandler("policecar",policecarmaker)
  928. addCommandHandler("copcar",copcarmaker)
  929. -- /blip stuff
  930.  
  931. function bluroff(source)
  932.     setPlayerBlurLevel(source,0)
  933.     outputChatBox("disabled your motion blur",source,200,200,200)
  934. end
  935.  
  936. addCommandHandler("noblur",bluroff)
  937.  
  938. function sendmes()
  939. triggerClientEvent("metal")
  940. end
  941.  
  942. addCommandHandler("\m/",sendmes)
  943.  
  944.  
  945.  
  946. --/ extra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement