Jump to content

FBI Job Marker Not Working?


Recommended Posts

This script is connected to ACL Group and when I created the ACL group this is how it looked like:

(My Username is illestiraqi)

Is there anything wrong with LUA file, ACL Group, or Both? For me they seem alright... but I just want to have it connected to the ACL group please

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(isPedInVehicle(hitElement)) 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 

Link to comment

the only thing wrong with the lua script that will give you some nasty debug errors too is that you need to check the element type and make sure it's a player

Use this: if getElementType(hitElement) ~= 'player' then return end

Put it in the first line of the function

Link to comment

Make it server-Side on meta.xml

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 

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