Guest User

Untitled

a guest
Apr 22nd, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. function BuyItemOnServer(item_name,data,value)
  2. player_money = getPlayerMoney(source)
  3. if(item_name == "item_pizza") then
  4. if ( player_money >= 200) then
  5. setElementData(source,"Pizza",getElementData(source,"Pizza") + 4)
  6. takePlayerMoney(source, 200)
  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(item_name == "item_apa") then
  13. if ( player_money >= 100) then
  14. setElementData(source,"Water Bottle",getElementData(source,"Water Bottle") + 4)
  15. takePlayerMoney(source, 100)
  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. if(item_name == "item_coy") then
  22. if ( player_money >= 1000) then
  23. setElementData(source, "MAX_Slots" , 36 )
  24. takePlayerMoney(source, 1000)
  25. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  26. else
  27. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  28. end
  29. end
  30. if(item_name == "item_haina") then
  31. if ( player_money >= 300) then
  32. setElementData(source, "Camouflage Clothing",getElementData(source,"Camouflage Clothing") + 1)
  33. takePlayerMoney(source, 300)
  34. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  35. else
  36. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  37. end
  38. end
  39. if(item_name == "item_motor") then
  40. if ( player_money >= 1000) then
  41. setElementData(source, "Engine",getElementData(source,"Engine") + 1)
  42. takePlayerMoney(source, 1000)
  43. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  44. else
  45. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  46. end
  47. end
  48. if(item_name == "item_gas") then
  49. if ( player_money >= 500) then
  50. setElementData(source, "Full Gas Canister",getElementData(source,"Full Gas Canister") + 1)
  51. takePlayerMoney(source, 500)
  52. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  53. else
  54. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  55. end
  56. end
  57. if(item_name == "item_tkp") then
  58. if ( player_money >= 1000) then
  59. setElementData(source, "Tire",getElementData(source,"Tire") + 1)
  60. setElementData(source, "Tank Parts",getElementData(source,"Tank Parts") + 1)
  61. takePlayerMoney(source, 1000)
  62. outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
  63. else
  64. outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
  65. end
  66. end
  67. end
  68.  
  69. addEvent("onClientBuyItem", true)
  70. addEventHandler("onClientBuyItem", getRootElement(), BuyItemOnServer)
  71. --------------------------------------------------------------------------------------------------------------
  72. --ItemShop--
  73. marker2 = createMarker(-336.8037109375, 1516.263671875, 74.359375, "cylinder", 3, 0, 255, 0, 0 )
  74. ped2 = createPed (50, -336.8037109375, 1516.263671875, 75.359375, -90, true)
  75. pedClo = createColSphere (-336.8037109375, 1516.263671875, 75.359375, 3)
  76. attachElements(pedCol, ped2)
  77. --------------------------------------------------------------------------------------------------------------
  78.  
  79. function HitMark2(hitPlayer)
  80. triggerClientEvent (hitPlayer,"openWindow2",getRootElement(),hitPlayer)
  81. end
  82. addEventHandler("onMarkerHit", marker2, HitMark2)
Advertisement
Add Comment
Please, Sign In to add comment