Jump to content

open window on marker hit


swag_k_dog

Recommended Posts

I made a separate client-side script for the window:


GUIEditor = {
    label = {},
    staticimage = {}
}
    function openMissionWindow()
        missWINDOW = guiCreateWindow(969, 223, 387, 483, "THIEVES", false)
        guiWindowSetMovable(missWINDOW, false)
        guiWindowSetSizable(missWINDOW, false)
        guiSetAlpha(missWINDOW, 1.00)

        btnACCEPT = guiCreateButton(0.02, 0.92, 0.33, 0.06, "ACCEPT MISSION", true, missWINDOW)
        btnCLOSE = guiCreateButton(0.89, 0.92, 0.08, 0.06, "X", true, missWINDOW)
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.03, 0.05, 0.26, 0.21, ":heist001/images/windowIMAGE.png", true, missWINDOW)
        windINFO = guiCreateLabel(0.31, 0.05, 0.65, 0.21, "The bank just got a new alarm system which\nhasn't been tested yet. It is the perfect\nmoment for a heist. \n\nGrap yo' :~ and come here to discuss the\nplan.\n", true, missWINDOW)
        windDETAILS = guiCreateLabel(0.02, 0.29, 0.95, 0.08, "When you're ready, just enter the building. We're waiting for you.\nDon't bring anyone..\n", true, missWINDOW)
        GUIEditor.label[1] = guiCreateLabel(19, 383, 358, 24, "REWARDS:       $100.000            EXP 5000", false, missWINDOW)    
    end

and the marker script(separate file):

heist001marker = createMarker(1809.6, -1168.8, 22.8, "cylinder", 1, 255, 0, 0)

function openMission()
  exports.heist001:openMissionWindow()
 end
 
addEventHandler("onPlayerMarkerHit",heist001marker, openMission)

the window doesnt appear when I hit the marker.

help?

Link to comment
10 minutes ago, swag_k_dog said:

addEventHandler("onPlayerMarkerHit",heist001marker, openMission)

There is no such onPlayerMarkerHit function, it's onClientMarkerHit when client side. Also if those files are in the same resource you don't need the "exports.heist001" bit.

Also you need to add a check in openMission to make sure that the player that is entering the marker is the local player, otherwise this GUI would open for all players whenever anyone enters it.

Edited by Arran
Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...