Rexy Posted May 21, 2018 Share Posted May 21, 2018 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
LilDawage Posted May 22, 2018 Share Posted May 22, 2018 (edited) 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 May 22, 2018 by LilDawage Link to comment
Rexy Posted May 22, 2018 Author Share Posted May 22, 2018 11 hours ago, LilDawage said: triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'Military' ) Its not working,& onJobPedClicked it will allow everyone to use the job Link to comment
LilDawage Posted May 22, 2018 Share Posted May 22, 2018 17 hours ago, LilDawage said: 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) Link to comment
Rexy Posted May 22, 2018 Author Share Posted May 22, 2018 3 hours ago, LilDawage said: it doesn't work for the members the menu does not pop up. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now