Jump to content

[Help]Enter on marker with gang_system


Hassam

Recommended Posts

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

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

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
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
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
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

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...