Mr.Dead Posted June 29, 2017 Share Posted June 29, 2017 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
pa3ck Posted June 29, 2017 Share Posted June 29, 2017 What do you mean you want to make it with groups? You mean you want to restrict the onMarkerHit event to teams/specific team? Try to explain it better.. Link to comment
Mr.Dead Posted June 29, 2017 Author Share Posted June 29, 2017 Just now, pa3ck said: What do you mean you want to make it with groups? You mean you want to restrict the onMarkerHit event to teams/specific team? Try to explain it better.. yes i want to make this job only for groups Link to comment
pa3ck Posted June 29, 2017 Share Posted June 29, 2017 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 1 Link to comment
Mr.Dead Posted June 29, 2017 Author Share Posted June 29, 2017 Just now, pa3ck said: What do you mean you want to make it with groups? You mean you want to restrict the onMarkerHit event to teams/specific team? Try to explain it better.. Thanks pa3ck 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