Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function BuyWeaponOnServer(weapon_name,data,value)
- player_money = getPlayerMoney(source)
- if(weapon_name == "weapon_M4A1") then
- if ( player_money >= 500) then
- setElementData(source,"M4A1",getElementData(source,"M4A1") + 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(weapon_name == "weapon_AK-47") then
- if ( player_money >= 500) then
- setElementData(source,"AK-47",getElementData(source,"AK-47") + 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(weapon_name == "weapon_CZ550") then
- if ( player_money >= 700) then
- setElementData(source,"CZ 550",getElementData(source,"CZ 550") + 1)
- takePlayerMoney(source, 700)
- 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(weapon_name == "weapon_bizon") then
- if ( player_money >= 300) then
- setElementData(source,"bizon",getElementData(source,"bizon") + 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(weapon_name == "weapon_topor") then
- if ( player_money >= 200) then
- setElementData(source,"Hatchet",getElementData(source,"Hatchet") + 1)
- 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(weapon_name == "weapon_tool") then
- if ( player_money >= 200) then
- setElementData(source,"Map",getElementData(source,"Map") + 1)
- setElementData(source,"GPS",getElementData(source,"GPS") + 1)
- setElementData(source,"Toolbox",getElementData(source,"Toolbox") + 1)
- 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(weapon_name == "weapon_m4a1mag") then
- if ( player_money >= 300) then
- setElementData(source,"M4 Mag",getElementData(source,"M4 Mag") + 50)
- 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(weapon_name == "weapon_akmag") then
- if ( player_money >= 300) then
- setElementData(source,"AK Mag",getElementData(source,"AK Mag") + 50)
- 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(weapon_name == "weapon_czmag") then
- if ( player_money >= 300) then
- setElementData(source,"CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 50)
- 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(weapon_name == "weapon_bizonmag") then
- if ( player_money >= 150) then
- setElementData(source,"Desert Eagle Mag",getElementData(source,"Desert Eagle Mag") + 50)
- takePlayerMoney(source, 150)
- 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("onClientBuyWeapon", true)
- addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer)
- --------------------------------------------------------------------------------------------------------------
- ---------------------------------------- GunShop -------------------------------------------------------------
- marker1 = createMarker(-336.56777954102, 1530.0159912109, 74.624549865723, "cylinder", 3, 0, 255, 0, 0 )
- ped1 = createPed (47, -336.56777954102, 1530.0159912109, 75.624549865723, -100, true)
- pedClo = createColSphere (-336.56777954102, 1530.0159912109, 75.624549865723, 3)
- attachElements(pedCol, ped1)
- createBlipAttachedTo(ped1, 6)
- --------------------------------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------------------------------
- function HitMark(hitPlayer)
- triggerClientEvent (hitPlayer,"openWindow1",getRootElement(),hitPlayer)
- end
- addEventHandler("onMarkerHit", marker1, HitMark)
Advertisement
Add Comment
Please, Sign In to add comment