Advertisement
Laine_prikol

errors

Jun 9th, 2017
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.05 KB | None | 0 0
  1. script_name("GuiMakegun for Samp RP")
  2. script_author("Laine_prikol")
  3. script_description("GUI for command sellgun Samp RP or other servers with SRP gamemode")
  4.  
  5. require "lib.moonloader"
  6. require "lib.sampfuncs"
  7.  
  8.  
  9. function main()
  10. activation_key = 73 -- You can change this key
  11.     patrons = 1
  12.     guname = "none"
  13.     result, playerid = sampGetPlayerIdByCharHandle(playerPed)
  14. sampAddChatMessage("GuiMakegun by Laine_prikol loaded Press I to open menu!", 0x00ff00)
  15.    while true do
  16.    wait(0)
  17.     if isKeyDown(activation_key) then
  18.         sampShowDialog(20, "GUIMakeGun for Samp-RP", "SDPistol 15 material-clip\nDeagle 21 material-clip\nShotgun 3 material-ammo\nSMG 60 material-clip\nAK-47 90 material-clip\nM4 150 material-clip\nRifle 5 material-ammo", "Make", "Close", 2)
  19.         dialogresponse()
  20.         dialogresponse2()
  21.         end
  22. end
  23. end
  24. function dialogresponse()
  25.     repeat
  26.       wait(0)
  27.       result, button, list, input = sampHasDialogRespond(20)
  28.     until result
  29.     if list == 0 then
  30.         sampShowDialog(21, "Input", "Enter ammo for SDPistol:", "Make", "Close", 1)
  31.         guname = "SdPistol"
  32.     end
  33.     if list == 1 then
  34.         sampShowDialog(21, "Input", "Enter ammo for Deagle:", "Make", "Close", 1)
  35.         guname = "Deagle"
  36.     end
  37.     if list == 2 then
  38.         sampShowDialog(21, "Input", "Enter ammo for Shotgun:", "Make", "Close", 1)
  39.         guname = "Shotgun"
  40.     end
  41.     if list == 3 then
  42.         sampShowDialog(21, "Input", "Enter ammo for SMG:", "Make", "Close", 1)
  43.         guname = "SMG"
  44.     end
  45.     if list == 4 then
  46.         sampShowDialog(21, "Input", "Enter ammo for AK-47:", "Make", "Close", 1)
  47.         guname = "AK-47"
  48.     end
  49.     if list == 5 then
  50.         sampShowDialog(21, "Input", "Enter ammo for M4:", "Make", "Close", 1)
  51.         guname = "M4"
  52.     end
  53.     if list == 6 then
  54.         sampShowDialog(21, "Input", "Enter ammo for Rifle:", "Make", "Close", 1)
  55.         guname = "Rifle"
  56.     end
  57. end
  58. function dialogresponse2()
  59.     repeat
  60.       wait(0)
  61.       result, button, list, input = sampHasDialogRespond(21)
  62.     until result
  63.     patrons = input
  64.     sampAddChatMessage("You make: "..guname.." with "..patrons.." ammo", 0xffff00)
  65.     sampSendChat("/sellgun "..guname.." "..patrons.." 4 "..playerid)
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement