Jump to content

I need a help


Rexy

Recommended Posts

im actually stuck, i need to change this code to a clan only job none else can use it expect the specified clan

    elseif ( name == 'Military' ) then
        create3DText ( 'Military', { x, y, z }, { 10,105,6  }, { nil, true } )
        local p = createElement ( "GodmodePed" )
        setElementData ( p, "Model", 287 )
		setElementDimension ( p, 0  )
        setElementData ( p, "Position", { x, y, z, rz } )
        createBlip ( x, y, z, 62, 2, 255, 255, 255, 255, 0, 450 )
        addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p )
            if ( getElementData ( p ,'Group' ) == 'Military' or ( getElementData ( p, "staffLevel" ) or 0 ) > 7  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
local gang = exports.nggroups:getPlayerGroup( p );
if ( gang and exports.nggroups:getGroupType(gang) == "Gang" ) then
	return exports.ngmessages:sendClientMessage("You can't take this job if you are in gang", p, 255, 0, 0 )  end
                triggerClientEvent ( p, 'NGJobs:onJobPedClicked', p, 'military' )
            end
        end )

 

Link to comment
22 hours ago, Rexy said:

im actually stuck, i need to change this code to a clan only job none else can use it expect the specified clan


    elseif ( name == 'Military' ) then
        create3DText ( 'Military', { x, y, z }, { 10,105,6  }, { nil, true } )
        local p = createElement ( "GodmodePed" )
        setElementData ( p, "Model", 287 )
		setElementDimension ( p, 0  )
        setElementData ( p, "Position", { x, y, z, rz } )
        createBlip ( x, y, z, 62, 2, 255, 255, 255, 255, 0, 450 )
        addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p )
         local gang = exports.NGGroups:getPlayerGroup(p)=="Military"
			 if (not gang ) then 
			 return exports.NGMessages:sendClientMessage ( "You are not a part of Military to get Job", p, 0, 255, 110 ) end
             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, 'Military' )
      end
    end)

 

you are welcome 

Edited by LilDawage
Link to comment
17 hours ago, LilDawage said:

 

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