Sign in to follow this  
Sami_~>

how to add markers

Recommended Posts

i make a script of shop weapons. i want to add  markers and blips on ammunation when player went to ammunation the gui opens and player can buy weapons.

how to do?

script:

Server Side:


outputChatBox ( "PRESS F5 TO OPEN A SHOP OF HEAVY WEAPONS", getRootElement(), 255, 0, 0, true )


addEvent("w1",true)
addEventHandler("w1",root,
function()
local PlayerMoney = getPlayerMoney(source)
 if ( PlayerMoney >= 60000) then
 takePlayerMoney(source,60000)
giveWeapon ( source ,  36,3 )
setPedWeaponSlot(source, getSlotFromWeapon(36))
local name = getPlayerName(source)
outputChatBox ( "#330079" .. name .. " #00FF00 Has Bought  Weapon : Heat seeking RPG", getRootElement(), 255, 0, 0, true )  
else
outputChatBox("You don't have $60000 ", source, 255, 0, 0, true)
end
end
)
------------------------------------------------------------------------------------------
 
addEvent("w2",true)
addEventHandler("w2",root,
function()
local PlayerMoney = getPlayerMoney(source)
if ( PlayerMoney >= 100000) then
takePlayerMoney(source,100000)
giveWeapon ( source ,  38,50 )
setPedWeaponSlot(source, getSlotFromWeapon(38))
local name = getPlayerName(source)
outputChatBox ( "#330079" .. name .. " #00FF00 Has Bought  Weapon : MiniGun ", getRootElement(), 255, 0, 0, true )
else
outputChatBox("You don't have $100000", source, 255, 0, 0, true)
end
end
)
 ---------------------------------------------------------------------------------
 
addEvent("w3",true)
addEventHandler("w3",root,
function()
local PlayerMoney = getPlayerMoney(source)
if ( PlayerMoney >= 60000) then
takePlayerMoney(source,60000)
giveWeapon ( source ,  35,3 )
setPedWeaponSlot(source, getSlotFromWeapon(35))
local name = getPlayerName(source)
outputChatBox ( "#330079" .. name .. " #00FF00 Has Bought  Weapon : Rocket Launcher ", getRootElement(), 255, 0, 0, true )
else
outputChatBox("You don't have $60000 ", source, 255, 0, 0, true)
end
end
)

client side :

GUIEditor = {
    window = {},
    staticimage = {},
    label = {}
}
 
        GUIEditor.window[1] = guiCreateWindow(300, 111, 400, 408, "Weapon Shop", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFB0303")
 
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 286, 345, 113, "quieditor/images/logohunter.png", false, GUIEditor.window[1])
        GUIEditor.staticimage[2] = guiCreateStaticImage(248, 89, 106, 105, "quieditor/images/rocketla.png", false, GUIEditor.window[1])
        w3 = guiCreateButton(258, 210, 100, 67, "RPG$60000", false, GUIEditor.window[1])
        GUIEditor.staticimage[3] = guiCreateStaticImage(124, 92, 123, 99, "quieditor/images/minigun.png", false, GUIEditor.window[1])
        w2 = guiCreateButton(138, 210, 100, 67, "MiniGun$100000", false, GUIEditor.window[1])
        GUIEditor.staticimage[4] = guiCreateStaticImage(9, 91, 113, 100, "quieditor/images/heatseek.png", false, GUIEditor.window[1])
        w1 = guiCreateButton(22, 210, 100, 67, "HRPG$60000", false, GUIEditor.window[1])
        GUIEditor.label[1] = guiCreateLabel(18, 33, 323, 46, "------------------", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[1], "sa-gothic")
        guiLabelSetColor(GUIEditor.label[1], 9, 255, 3)    
 
guiSetVisible(GUIEditor.window[1],false)
 
bindKey ( "F5" , "down" , function()
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1]))
    showCursor(not isCursorShowing())
    end
)
 
addEventHandler ("onClientGUIClick", root,
function()
if ( source ==  w1 ) then
triggerServerEvent("w1",getLocalPlayer())
elseif (source == w2) then
triggerServerEvent("w2",getLocalPlayer())
elseif (source == w3) then
triggerServerEvent("w3",getLocalPlayer())
end
end
)

 

Share this post


Link to post

i did it for you xD 

----Client

GUIEditor = {
    window = {},
    staticimage = {},
    label = {}
}
 
        GUIEditor.window[1] = guiCreateWindow(300, 111, 400, 408, "Weapon Shop", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFB0303")
        btnClose = guiCreateButton(313, 371, 77, 27, "Close", false, GUIEditor.window[1])    		
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 286, 345, 113, "quieditor/images/logohunter.png", false, GUIEditor.window[1])
        GUIEditor.staticimage[2] = guiCreateStaticImage(248, 89, 106, 105, "quieditor/images/rocketla.png", false, GUIEditor.window[1])
        w3 = guiCreateButton(258, 210, 100, 67, "RPG$60000", false, GUIEditor.window[1])
        GUIEditor.staticimage[3] = guiCreateStaticImage(124, 92, 123, 99, "quieditor/images/minigun.png", false, GUIEditor.window[1])
        w2 = guiCreateButton(138, 210, 100, 67, "MiniGun$100000", false, GUIEditor.window[1])
        GUIEditor.staticimage[4] = guiCreateStaticImage(9, 91, 113, 100, "quieditor/images/heatseek.png", false, GUIEditor.window[1])
        w1 = guiCreateButton(22, 210, 100, 67, "HRPG$60000", false, GUIEditor.window[1])
        GUIEditor.label[1] = guiCreateLabel(18, 33, 323, 46, "------------------", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[1], "sa-gothic")
        guiLabelSetColor(GUIEditor.label[1], 9, 255, 3) 
        guiSetVisible(GUIEditor.window[1],false)
 
bindKey ( "F5" , "down" , function()
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1]))
    showCursor(not isCursorShowing())
    end
)

addEventHandler("onClientGUIClick", btnClose,
			function()
				if source == this then
                    guiSetVisible(GUIEditor.window[1],false)
					    showCursor(guiGetVisible(wnd))
				end
			end
)

local EnterShopMarker1 = createMarker(1367.74, -1279.6, 12.55, "cylinder", 1.5, 255, 150, 0, 150)
local ExitShopMarker1 = createMarker(285.34, -41.7, 1000.5, "cylinder", 1.5, 255, 150, 0, 150)
local OpenShopMarker1 = createMarker(295.5, -37.4, 1000.5, "cylinder", 2, 200, 150, 0, 150)
setElementInterior(ExitShopMarker1, 1)
setElementInterior(OpenShopMarker1, 1)
createBlipAttachedTo(EnterShopMarker1, 6)

local EnterShopMarker2 = createMarker(2159.16, 943.13, 9.82, "cylinder", 1.5, 255, 150, 0, 150)
local ExitShopMarker2 = createMarker(285.67, -85.82, 1000.5, "cylinder", 1.5, 255, 150, 0, 150)
local OpenShopMarker2 = createMarker(295.62, -79, 1000.5, "cylinder", 2, 200, 150, 0, 150)
setElementInterior(ExitShopMarker2, 4)
setElementInterior(OpenShopMarker2, 4)
createBlipAttachedTo(EnterShopMarker2, 6)

local EnterShopMarker3 = createMarker(2400.65, -1981.23, 12.54, "cylinder", 1.5, 255, 150, 0, 150)
local ExitShopMarker3 = createMarker(297, -111.62, 1000.5, "cylinder", 1.5, 255, 150, 0, 150)
local OpenShopMarker3 = createMarker(289.4, -108.5, 1000.51, "cylinder", 2, 200, 150, 0, 150)
setElementInterior(ExitShopMarker3, 6)
setElementInterior(OpenShopMarker3, 6)
createBlipAttachedTo(EnterShopMarker3, 6)

local EnterShopMarker4 = createMarker(-2626.8, 209.3, 3.6, "cylinder", 1.5, 255, 150, 0, 150)
local ExitShopMarker4 = createMarker(316.53, -169.61, 998.6, "cylinder", 1.5, 255, 150, 0, 150)
local OpenShopMarker4 = createMarker(311.65, -164.95, 998.6, "cylinder", 2, 200, 150, 0, 150)
setElementInterior(ExitShopMarker4, 6)
setElementInterior(OpenShopMarker4, 6)
createBlipAttachedTo(EnterShopMarker4, 6)

local EnterShopMarker5 = createMarker(2539, 2083.91, 9.82, "cylinder", 1.5, 255, 150, 0, 150)
local ExitShopMarker5 = createMarker(315.65, -143, 998.6, "cylinder", 1.5, 255, 150, 0, 150)
local OpenShopMarker5 = createMarker(313.13, -133.44, 998.6, "cylinder", 2, 200, 150, 0, 150)
setElementInterior(ExitShopMarker5, 7)
setElementInterior(OpenShopMarker5, 7)
createBlipAttachedTo(EnterShopMarker5, 6)

addEventHandler("onClientMarkerHit", root,
function(player)
	if player == localPlayer and not isPedInVehicle(player) then
		if source == EnterShopMarker1 then
			triggerServerEvent("EnterShop", localPlayer, 1, 285.81, -39.73, 1001.52)
		elseif source == ExitShopMarker1 then
			triggerServerEvent("EnterShop", localPlayer, 0, 1365.96, -1280.34, 13.75)
		--
		elseif source == EnterShopMarker2 then
			triggerServerEvent("EnterShop", localPlayer, 4, 286.2, -83.42, 1001.52)
		elseif source == ExitShopMarker2 then
			triggerServerEvent("EnterShop", localPlayer, 0, 2157.16, 943.13, 10.82)
		--
		elseif source == EnterShopMarker3 then
			triggerServerEvent("EnterShop", localPlayer, 6, 295.53, -108.8, 1001.52)
		elseif source == ExitShopMarker3 then
			triggerServerEvent("EnterShop", localPlayer, 0, 2400.65, -1979.5, 13.54)
		--	
		elseif source == EnterShopMarker4 then
			triggerServerEvent("EnterShop", localPlayer, 6, 316.53, -167, 999.6)
		elseif source == ExitShopMarker4 then
			triggerServerEvent("EnterShop", localPlayer, 0, -2626.8, 212, 4.6)
		--
		elseif source == EnterShopMarker5 then
			triggerServerEvent("EnterShop", localPlayer, 7, 313.65, -141.8, 999.6)
		elseif source == ExitShopMarker5 then
			triggerServerEvent("EnterShop", localPlayer, 0, 2536.5, 2083.91, 10.82)
		--
		elseif source == OpenShopMarker1 or source == OpenShopMarker2 or source == OpenShopMarker3 or source == OpenShopMarker4 or source == OpenShopMarker5 or source == OpenPoliceShopMarker then
			guiSetVisible(GUIEditor.window[1], true)
						showCursor(true)

		end
	end
end)

addEventHandler("onClientMarkerLeave", root,
function(player)
	if player == localPlayer then
		if source == OpenShopMarker1 then
			guiSetVisible(GUIEditor.window[1], false)
			showCursor(false)
		end
	end
end)
 
addEventHandler ("onClientGUIClick", root,
function()
if ( source ==  w1 ) then
triggerServerEvent("w1",getLocalPlayer())
elseif (source == w2) then
triggerServerEvent("w2",getLocalPlayer())
elseif (source == w3) then
triggerServerEvent("w3",getLocalPlayer())
end
end
)

 

-----Server 


outputChatBox ( "PRESS F5 TO OPEN A SHOP OF HEAVY WEAPONS", getRootElement(), 255, 0, 0, true )


addEvent("w1",true)
addEventHandler("w1",root,
function()
local PlayerMoney = getPlayerMoney(source)
 if ( PlayerMoney >= 60000) then
 takePlayerMoney(source,60000)
giveWeapon ( source ,  36,3 )
setPedWeaponSlot(source, getSlotFromWeapon(36))
local name = getPlayerName(source)
outputChatBox ( "#330079" .. name .. " #00FF00 Has Bought  Weapon : Heat seeking RPG", getRootElement(), 255, 0, 0, true )  
else
outputChatBox("You don't have $60000 ", source, 255, 0, 0, true)
end
end
)
------------------------------------------------------------------------------------------
 
addEvent("w2",true)
addEventHandler("w2",root,
function()
local PlayerMoney = getPlayerMoney(source)
if ( PlayerMoney >= 100000) then
takePlayerMoney(source,100000)
giveWeapon ( source ,  38,50 )
setPedWeaponSlot(source, getSlotFromWeapon(38))
local name = getPlayerName(source)
outputChatBox ( "#330079" .. name .. " #00FF00 Has Bought  Weapon : MiniGun ", getRootElement(), 255, 0, 0, true )
else
outputChatBox("You don't have $100000", source, 255, 0, 0, true)
end
end
)

addEvent("EnterShop", true)
addEventHandler("EnterShop", root,
function(int, x, y, z)
	setElementInterior(source, int)
	setElementPosition(source, x, y, z)
end)
 ---------------------------------------------------------------------------------
 
addEvent("w3",true)
addEventHandler("w3",root,
function()
local PlayerMoney = getPlayerMoney(source)
if ( PlayerMoney >= 60000) then
takePlayerMoney(source,60000)
giveWeapon ( source ,  35,3 )
setPedWeaponSlot(source, getSlotFromWeapon(35))
local name = getPlayerName(source)
outputChatBox ( "#330079" .. name .. " #00FF00 Has Bought  Weapon : Rocket Launcher ", getRootElement(), 255, 0, 0, true )
else
outputChatBox("You don't have $60000 ", source, 255, 0, 0, true)
end
end
)

 

but i didn't remove The bind of F5

Edited by Moha|M|
  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.