Hassam Posted July 28, 2012 Share Posted July 28, 2012 Hello, I'm trying add marker and when enter with this name specific but I can't.I'm using gang_system from castillo function swatjob(hitElement) if (hitElement == localPlayer) then if ( getElementData ( hitElement, "Gang Name" ) == "SWAT Team" ) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", marker, swatjob) Link to comment
TAPL Posted July 28, 2012 Share Posted July 28, 2012 you forgot one 'end' function swatjob(hitElement) if (hitElement == localPlayer) then if ( getElementData ( hitElement, "Gang Name" ) == "SWAT Team" ) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", marker, swatjob) Link to comment
Hassam Posted July 28, 2012 Author Share Posted July 28, 2012 it's fixed, and don't worked Link to comment
TAPL Posted July 28, 2012 Share Posted July 28, 2012 it's fixed, and don't worked fixed and don't worked? ~_~ are you sure from the element data key? i mean this "Gang Name" anyway where is your marker code? did you check /debugscript 3? no error? Link to comment
Hassam Posted July 28, 2012 Author Share Posted July 28, 2012 No error, and when I enter on mark, I can't see the gui Edit:Here marker code: local marker = createMarker(1262.7073974609, -1643.3990478516, 13, 'cylinder', 2, 255, 255, 255, 255) Link to comment
TAPL Posted July 28, 2012 Share Posted July 28, 2012 try local marker = createMarker(1262.7073974609, -1643.3990478516, 13, 'cylinder', 2, 255, 255, 255, 255) function swatjob(hitElement) if (hitElement == localPlayer) then if (getElementData(hitElement, "gang") == "SWAT Team") then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", marker, swatjob) Link to comment
Hassam Posted July 28, 2012 Author Share Posted July 28, 2012 no, didn't worked, I think need export the script Link to comment
TAPL Posted July 28, 2012 Share Posted July 28, 2012 no, didn't worked, I think need export the script impossible, show your full code, include the gui Link to comment
Hassam Posted July 28, 2012 Author Share Posted July 28, 2012 local marker = createMarker(1262.7073974609, -1643.3990478516, 13, 'cylinder', 2, 255, 255, 255, 255) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(1031,232,301,397,"SWAT job",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(19,33,273,215,"To take SWAT team job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function swatjob(hitElement) if (hitElement == localPlayer) then if (getElementData(hitElement, "gang") == "SWAT Team") then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", marker, swatjob) function swatjobleave(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, swatjobleave) function joinTeam() triggerServerEvent("setswat",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeswatWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeswatWindow, false) Link to comment
TAPL Posted July 28, 2012 Share Posted July 28, 2012 local marker = createMarker(1262.7073974609, -1643.3990478516, 13, 'cylinder', 2, 255, 255, 255, 255) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} local x,y = guiGetScreenSize() windowjob = guiCreateWindow(x/2-150,y/2-199,301,397,"SWAT job",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(19,33,273,215,"To take SWAT team job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function swatjob(hitElement) if (hitElement == localPlayer) then if (getElementData(hitElement, "gang") == "SWAT Team") then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", marker, swatjob) function swatjobleave(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, swatjobleave) function joinTeam() triggerServerEvent("setswat",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeswatWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeswatWindow, false) Link to comment
TAPL Posted July 28, 2012 Share Posted July 28, 2012 don't work again huh? i tested the code and it work. Link to comment
Anderl Posted July 28, 2012 Share Posted July 28, 2012 isGangMember - Arguments: gangName, accountName. Returns: true or false. Link to comment
Castillo Posted July 28, 2012 Share Posted July 28, 2012 The resource: "gang_system" uses "gang" element data as TAPL used on his code. Link to comment
Anderl Posted July 28, 2012 Share Posted July 28, 2012 The resource: "gang_system" uses "gang" element data as TAPL used on his code. Would not be easier using "isGangMember"? Link to comment
Castillo Posted July 28, 2012 Share Posted July 28, 2012 His script is client side, that function is server side as it uses account names. Link to comment
Hassam Posted July 29, 2012 Author Share Posted July 29, 2012 is working, thanks a lot for help me. Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Share Posted August 2, 2012 (edited) EDIT: how to make when i take Swat job my team set "SWAT Team" + Skin (ID) Edited August 2, 2012 by Guest Link to comment
Castillo Posted August 2, 2012 Share Posted August 2, 2012 I don't understand what do you mean. Link to comment
Castillo Posted August 2, 2012 Share Posted August 2, 2012 setPlayerTeam -- to set the player team setElementModel -- to set the player skin. You could combine it with: onElementDataChange, so when your "Occupation" element data changes to "SWAT" it'll auto set team + skin. Link to comment
TAPL Posted August 2, 2012 Share Posted August 2, 2012 EDIT: how to make when i take Swat job my team set "SWAT Team" + Skin (ID) This is the server side part the topic owner didn't post it you have to make it the trigger already there in line 38 triggerServerEvent("setswat",localPlayer) Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Share Posted August 2, 2012 ya i know that but what line i must add that? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now