Jump to content

Help me


Mr.Dead

Recommended Posts

i have job system i want to make it with groups

elseif ( name == 'Police' ) then
        create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } )
        local p = createElement ( "GodmodePed" )
        setElementData ( p, "Model", 281 )
        setElementData ( p, "Position", { x, y, z, rz } )
        -- createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 )
        addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p )
            if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then
                if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then
                    return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 )
                end
                triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'police' )
            end

Link to comment

Okay, all you have to do is check the player's team in the if statement inside onMarkerHit event handler.

if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) and getPlayerTeam ( p ) == getTeamFromName("YOUR_TEAM_NAME") ) then

 

  • Like 1
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...