Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function BuyItemOnServer(item_name,data,value)
- player_money = getPlayerMoney(source)
- if(item_name == "item_pizza") then
- if ( player_money >= 200) then
- setElementData(source,"Pizza",getElementData(source,"Pizza") + 4)
- takePlayerMoney(source, 200)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- if(item_name == "item_apa") then
- if ( player_money >= 100) then
- setElementData(source,"Water Bottle",getElementData(source,"Water Bottle") + 4)
- takePlayerMoney(source, 100)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- if(item_name == "item_coy") then
- if ( player_money >= 1000) then
- setElementData(source, "MAX_Slots" , 36 )
- takePlayerMoney(source, 1000)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- if(item_name == "item_haina") then
- if ( player_money >= 300) then
- setElementData(source, "Camouflage Clothing",getElementData(source,"Camouflage Clothing") + 1)
- takePlayerMoney(source, 300)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- if(item_name == "item_motor") then
- if ( player_money >= 1000) then
- setElementData(source, "Engine",getElementData(source,"Engine") + 1)
- takePlayerMoney(source, 1000)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- if(item_name == "item_gas") then
- if ( player_money >= 500) then
- setElementData(source, "Full Gas Canister",getElementData(source,"Full Gas Canister") + 1)
- takePlayerMoney(source, 500)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- if(item_name == "item_tkp") then
- if ( player_money >= 1000) then
- setElementData(source, "Tire",getElementData(source,"Tire") + 1)
- setElementData(source, "Tank Parts",getElementData(source,"Tank Parts") + 1)
- takePlayerMoney(source, 1000)
- outputChatBox("#FF0000<SHOP>: #FFFFFFTransaction completed!", source, 255, 255, 255 , true)
- else
- outputChatBox("#FF0000<SHOP>: #FFFFFFNot enought money..!", source, 255, 255, 255 , true)
- end
- end
- end
- addEvent("onClientBuyItem", true)
- addEventHandler("onClientBuyItem", getRootElement(), BuyItemOnServer)
- --------------------------------------------------------------------------------------------------------------
- --ItemShop--
- marker2 = createMarker(-336.8037109375, 1516.263671875, 74.359375, "cylinder", 3, 0, 255, 0, 0 )
- ped2 = createPed (50, -336.8037109375, 1516.263671875, 75.359375, -90, true)
- pedClo = createColSphere (-336.8037109375, 1516.263671875, 75.359375, 3)
- attachElements(pedCol, ped2)
- --------------------------------------------------------------------------------------------------------------
- function HitMark2(hitPlayer)
- triggerClientEvent (hitPlayer,"openWindow2",getRootElement(),hitPlayer)
- end
- addEventHandler("onMarkerHit", marker2, HitMark2)
Advertisement
Add Comment
Please, Sign In to add comment