Advertisement
Guest User

RP Lua

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