Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. --[[
  2. Project: VitaOnline
  3. File: illegalweapons-client.lua
  4. Author(s): Sebihunter
  5. ]]--
  6.  
  7. -- Shop
  8. WeaponGUI_Window = {}
  9. WeaponGUI_Button = {}
  10. WeaponGUI_Grid = {}
  11. WeaponGUI_Column = {}
  12.  
  13. WeaponGUI_Window[1] = guiCreateWindow(screenWidth/2-155,screenHeight/2-202,289,403,"Illegaler Waffenhändler",false)
  14. WeaponGUI_Button[1] = guiCreateButton(179,379,101,15,"Schliessen",false,WeaponGUI_Window[1])
  15. WeaponGUI_Grid[1] = guiCreateGridList(16,33,264,336,false,WeaponGUI_Window[1])
  16. guiGridListSetSelectionMode(WeaponGUI_Grid[1],2)
  17. WeaponGUI_Column[1] = guiGridListAddColumn ( WeaponGUI_Grid[1], "Item", 0.9 )
  18. guiSetVisible( WeaponGUI_Window[1], false)
  19. guiWindowSetSizable ( WeaponGUI_Window[1], false )
  20.  
  21. local row = guiGridListAddRow(WeaponGUI_Grid[1])
  22. guiGridListSetItemText ( WeaponGUI_Grid[1], row, WeaponGUI_Column[1], "Desert Eagle (900 Vero)", false, false )
  23. row = guiGridListAddRow(WeaponGUI_Grid[1])
  24. guiGridListSetItemText ( WeaponGUI_Grid[1], row, WeaponGUI_Column[1], "MP5 (1400 Vero)", false, false )
  25. row = guiGridListAddRow(WeaponGUI_Grid[1])
  26. guiGridListSetItemText ( WeaponGUI_Grid[1], row, WeaponGUI_Column[1], "Hanfsamen (2500 Vero)", false, false )
  27. row = guiGridListAddRow(WeaponGUI_Grid[1])
  28. guiGridListSetItemText ( WeaponGUI_Grid[1], row, WeaponGUI_Column[1], "Magische Miesmuschel (10 Vero)", false, false )
  29. row = guiGridListAddRow(WeaponGUI_Grid[1])
  30. guiGridListSetItemText ( WeaponGUI_Grid[1], row, WeaponGUI_Column[1], "AK-47 (10 Vero)", false, false )
  31.  
  32. function showWeaponGUI()
  33. if not getElementData(getLocalPlayer(), "isPlayerLoggedIn") == true then return end
  34. if not getElementData(getLocalPlayer(), "isWaitingForDeath") == false then return end
  35. if getElementData(getLocalPlayer(), "gang") == 0 then outputChatBox("Verpiss dich! Du bekommst hier nichts.", 255, 0, 0) return end
  36. guiSetVisible( WeaponGUI_Window[1], true)
  37. showCursor(true)
  38. showTutorialMessage("hjoe_1", "Hinterzimmer Joe bietet dir eine Standartauswahl von Waffen, auch ohne einen Waffenschein. Du kannst bei ihm ebenfalls Hanfsamen zum Anpflanzen kaufen.")
  39. end
  40.  
  41. function closeWeaponGUI()
  42. guiSetVisible( WeaponGUI_Window[1], false)
  43. showCursor(false)
  44. end
  45. addEventHandler ( "onClientGUIClick", WeaponGUI_Button[1], closeWeaponGUI )
  46.  
  47. function buyWeapon()
  48. local selectedRow, selectedCol = guiGridListGetSelectedItem( WeaponGUI_Grid[1] )
  49. local itemtext = guiGridListGetItemText ( WeaponGUI_Grid[1], selectedRow, selectedCol )
  50. if itemtext == "Desert Eagle (900 Vero)" then
  51. if checkMoney(900) == true then
  52. takePlayerMoneyEx(900)
  53. callServerFunction("giveItem", getLocalPlayer(), 9)
  54. --callServerFunction("giveWeapon", getLocalPlayer(), 24)
  55. outputChatBox("Du hast dir eine Desert Eagle gekauft (30 Schuss).", 0, 255, 0)
  56. end
  57. end
  58. if itemtext == "MP5 (1400 Vero)" then
  59. if checkMoney(1400) == true then
  60. takePlayerMoneyEx(1400)
  61. callServerFunction("giveItem", getLocalPlayer(), 10)
  62. --callServerFunction("giveWeapon", getLocalPlayer(), 29, 60)
  63. outputChatBox("Du hast dir eine MP5 gekauft (60 Schuss).", 0, 255, 0)
  64. end
  65. end
  66. if itemtext == "Hanfsamen (2500 Vero)" then
  67. if checkMoney(2500) == true then
  68. takePlayerMoneyEx(2500)
  69. callServerFunction("giveItem", getLocalPlayer(), 61)
  70. outputChatBox("Du hast dir einen Hanfsamen gekauft.", 0, 255, 0)
  71. end
  72. end
  73. if itemtext == "Magische Miesmuschel (10 Vero)" then
  74. outputChatBox("Versuch's doch einfach nochmal.", 255, 0, 0)
  75. end
  76. if itemtext == "AK 47 (10 Vero)" then
  77. if checkMoney(10) == true then
  78. takePlayerMoneyEx(10)
  79. callServerFunction("giveItem", getLocalPlayer(), 10)
  80. --callServerFunction("giveWeapon", getLocalPlayer(), 29, 60)
  81. outputChatBox("Du hast dir eine AK-47 gekauft (60 Schuss).", 0, 255, 0)
  82. end
  83. --closeWeaponGUI()
  84. end
  85. addEventHandler( "onClientGUIDoubleClick", WeaponGUI_Grid[1], buyWeapon, false );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement