Guest User

Untitled

a guest
Apr 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.48 KB | None | 0 0
  1. function BuyWeaponOnServer(weapon_name,data,value)
  2. player_money = getPlayerMoney(source)
  3. if(weapon_name == "weapon_M4A1") then
  4. if ( player_money >= 500) then
  5. setElementData(source,"M4A1",getElementData(source,"M4A1") + 1)
  6. takePlayerMoney(source, 500)
  7. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  8. else
  9. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  10. end
  11. end
  12. if(weapon_name == "weapon_AK-47") then
  13. if ( player_money >= 500) then
  14. setElementData(source,"AK-47",getElementData(source,"AK-47") + 1)
  15. takePlayerMoney(source, 500)
  16. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  17. else
  18. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  19. end
  20. end
  21.  
  22.  
  23. if(weapon_name == "weapon_CZ550") then
  24. if ( player_money >= 700) then
  25. setElementData(source,"CZ 550",getElementData(source,"CZ 550") + 1)
  26. takePlayerMoney(source, 700)
  27. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  28. else
  29. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  30. end
  31. end
  32. if(weapon_name == "weapon_bizon") then
  33. if ( player_money >= 300) then
  34. setElementData(source,"bizon",getElementData(source,"bizon") + 1)
  35. takePlayerMoney(source, 300)
  36. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  37. else
  38. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  39. end
  40. end
  41. if(weapon_name == "weapon_topor") then
  42. if ( player_money >= 200) then
  43. setElementData(source,"Hatchet",getElementData(source,"Hatchet") + 1)
  44. takePlayerMoney(source, 200)
  45. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  46. else
  47. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  48. end
  49. end
  50. if(weapon_name == "weapon_tool") then
  51. if ( player_money >= 200) then
  52. setElementData(source,"Map",getElementData(source,"Map") + 1)
  53. setElementData(source,"GPS",getElementData(source,"GPS") + 1)
  54. setElementData(source,"Toolbox",getElementData(source,"Toolbox") + 1)
  55. takePlayerMoney(source, 200)
  56. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  57. else
  58. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  59. end
  60. end
  61. if(weapon_name == "weapon_m4a1mag") then
  62. if ( player_money >= 300) then
  63. setElementData(source,"M4 Mag",getElementData(source,"M4 Mag") + 50)
  64. takePlayerMoney(source, 300)
  65. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  66. else
  67. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  68. end
  69. end
  70. if(weapon_name == "weapon_akmag") then
  71. if ( player_money >= 300) then
  72. setElementData(source,"AK Mag",getElementData(source,"AK Mag") + 50)
  73. takePlayerMoney(source, 300)
  74. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  75. else
  76. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  77. end
  78. end
  79. if(weapon_name == "weapon_czmag") then
  80. if ( player_money >= 300) then
  81. setElementData(source,"CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 50)
  82. takePlayerMoney(source, 300)
  83. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  84. else
  85. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  86. end
  87. end
  88. if(weapon_name == "weapon_bizonmag") then
  89. if ( player_money >= 150) then
  90. setElementData(source,"Desert Eagle Mag",getElementData(source,"Desert Eagle Mag") + 50)
  91. takePlayerMoney(source, 150)
  92. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  93. else
  94. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  95. end
  96. end
  97. end
  98.  
  99. addEvent("onClientBuyWeapon", true)
  100. addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer)
  101. --------------------------------------------------------------------------------------------------------------
  102. ---------------------------------------- GunShop -------------------------------------------------------------
  103. marker1 = createMarker(-336.56777954102, 1530.0159912109, 74.624549865723, "cylinder", 3, 0, 255, 0, 0 )
  104. ped1 = createPed (47, -336.56777954102, 1530.0159912109, 75.624549865723, -100, true)
  105. pedClo = createColSphere (-336.56777954102, 1530.0159912109, 75.624549865723, 3)
  106. attachElements(pedCol, ped1)
  107. createBlipAttachedTo(ped1, 6)
  108. --------------------------------------------------------------------------------------------------------------
  109. --------------------------------------------------------------------------------------------------------------
  110. function HitMark(hitPlayer)
  111. triggerClientEvent (hitPlayer,"openWindow1",getRootElement(),hitPlayer)
  112. end
  113. addEventHandler("onMarkerHit", marker1, HitMark)
Advertisement
Add Comment
Please, Sign In to add comment