Jump to content

Problem with Job Marker


Recommended Posts

I made FBI job and perfectly fine working. I made staff and isn't working, ill show both

FBI (Working Fine):

local Skinmarker = createMarker(919.59997558594, -1004.299987793, 37, "cylinder", 1.0, 33, 33, 33, 255) -- umkleide 
local theTeam = createTeam( "FBI", 31, 31, 31 ) 
addEventHandler("onMarkerHit", Skinmarker, 
function(hitElement) 
    if getElementType(hitElement) ~= 'player' then return end 
    if not(isFBI(hitElement)) then return end 
    setElementModel(hitElement, 286) 
            setPlayerTeam(hitElement, theTeam) 
end) 
function isFBI(thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "FBI" ) ) then 
        return true; 
    else 
        return false; 
    end 
end 

Staff Job (Not Working Fix please)

local Skinmarker = createMarker(1469, -1771.1999511719, 17.700000762939, "cylinder", 1.0, 109, 0, 164, 255) -- umkleide 
local theTeam = createTeam( "Staff", 109, 0, 164 ) 
addEventHandler("onMarkerHit", Skinmarker, 
function(hitElement) 
    if getElementType(hitElement) ~= 'player' then return end 
    if not(isSTAFF(hitElement)) then return end 
    setElementModel(hitElement, 217) 
            setPlayerTeam(hitElement, theTeam) 
end) 
function isSTAFF(thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        return true; 
    else 
        return false; 
    end 
end 

Link to comment

FBI & Staff Job

Server

  
  
local Skinmarker = createMarker(1469, -1771.1999511719, 17.700000762939, "cylinder", 1.0, 109, 0, 164, 255) -- umkleide 
theTeam = createTeam( "Staff", 109, 0, 164 ) 
local Skinmarker2 = createMarker(919.59997558594, -1004.299987793, 37, "cylinder", 1.0, 33, 33, 33, 255) -- umkleide 
theTeam2 = createTeam( "FBI", 31, 31, 31 ) 
  
addEventHandler("onMarkerHit", root, 
    function(hitElement) 
    if getElementType(hitElement) ~= 'player' then return end 
        if ( source == Skinmarker ) then 
            if not(isGroup(hitElement,"Admin")) then return end  
            setElementModel(hitElement, 217) 
            setPlayerTeam(hitElement, theTeam)       
        elseif ( source == Skinmarker2 ) then 
            if not(isGroup(hitElement,"FBI")) then return end 
            setElementModel(hitElement, 286) 
            setPlayerTeam(hitElement, theTeam2) 
        end      
    end 
) 
  
function isGroup(thePlayer,group) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( group ) ) then 
        return true; 
    else 
        return false; 
    end 
end 
  
  

Link to comment
FBI & Staff Job

Server

  
  
local Skinmarker = createMarker(1469, -1771.1999511719, 17.700000762939, "cylinder", 1.0, 109, 0, 164, 255) -- umkleide 
theTeam = createTeam( "Staff", 109, 0, 164 ) 
local Skinmarker2 = createMarker(919.59997558594, -1004.299987793, 37, "cylinder", 1.0, 33, 33, 33, 255) -- umkleide 
theTeam2 = createTeam( "FBI", 31, 31, 31 ) 
  
addEventHandler("onMarkerHit", root, 
    function(hitElement) 
    if getElementType(hitElement) ~= 'player' then return end 
        if ( source == Skinmarker ) then 
            if not(isGroup(hitElement,"Admin")) then return end  
            setElementModel(hitElement, 217) 
            setPlayerTeam(hitElement, theTeam)       
        elseif ( source == Skinmarker2 ) then 
            if not(isGroup(hitElement,"FBI")) then return end 
            setElementModel(hitElement, 286) 
            setPlayerTeam(hitElement, theTeam2) 
        end      
    end 
) 
  
function isGroup(thePlayer,group) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( group ) ) then 
        return true; 
    else 
        return false; 
    end 
end 
  
  

Dude you totally missed the whole point, there's a reason why they were made separate. I want it fixed separate. I just need want someone to fix the staff job ONLY

Link to comment

Server

  
local Staffmarker = createMarker(1469, -1771.1999511719, 17.700000762939, "cylinder", 1.0, 109, 0, 164, 255) -- umkleide 
theTeamStaff = createTeam( "Staff", 109, 0, 164 ) 
  
addEventHandler("onMarkerHit", root, 
    function(hitElement) 
    if getElementType(hitElement) ~= 'player' then return end 
        if ( source == Staffmarker ) then 
            if not(isGroup(hitElement,"Admin")) then return end -- group name 
            setElementModel(hitElement, 217) 
            setPlayerTeam(hitElement, theTeamStaff) 
        end     
    end 
) 
  
function isGroup(thePlayer,group) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( group ) ) then 
        return true; 
    else 
        return false; 
    end 
end 
  
  

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