TheSmart Posted July 14, 2015 Share Posted July 14, 2015 Hello guys! i'm wanted to make if player group type is gang so he can't join police team so tell me how can i make it please i need this ASAP Link to comment
Perfect Posted July 14, 2015 Share Posted July 14, 2015 What do you really mean by player group type ? player team, ACL group or something else. Link to comment
TheSmart Posted July 14, 2015 Author Share Posted July 14, 2015 i'm using xXMadeXx Group system Link to comment
TheSmart Posted July 14, 2015 Author Share Posted July 14, 2015 im trying it to make own self addEvent ("onPlayerJoinJob", true) addEventHandler( "onPlayerJoinJob", root, function (player) local gang = exports.NGGroups:getPlayerGroup ( player ) if ( getElementData(player, "Group" ) ~= "Gang" ) then i dont know what to do next Link to comment
Cadell Posted July 14, 2015 Share Posted July 14, 2015 u want to compare if player is in any gang then cant spawn police else do local getPlayergang = exports.NGGroups:getPlayerGroup(player) if getPlayergang == "gangname here" then outputChatbox"u cant u r in gang" else --your spawn stuff end Link to comment
LasHa Posted July 14, 2015 Share Posted July 14, 2015 i think you need to add new button in Group Gui. When player is going to create a group he need to choose which kind of group he is going to do like "Civilian" "Police" or "Criminal" or as you wish "Gang". after that you need to save somehow that group type is Gang and all players got from that type can't enter in police. Link to comment
TheSmart Posted July 14, 2015 Author Share Posted July 14, 2015 (edited) after that you need to save somehow that group type is Gang and all players got from that type can't enter in police. -___________________- if i know how to do it so why i come here uffff Edited July 16, 2015 by Guest Link to comment
TheSmart Posted July 14, 2015 Author Share Posted July 14, 2015 can you explain me how to use return ? im nab scripting D: Link to comment
GTX Posted July 15, 2015 Share Posted July 15, 2015 I think cancelEvent could do the job. I'm not familiar with xXMadeXx his group system. addEvent ("onPlayerJoinJob", true) addEventHandler( "onPlayerJoinJob", root, function (player) local gang = exports.NGGroups:getPlayerGroup ( player ) if gang ~= "Gang" then cancelEvent() end end ) Link to comment
TheSmart Posted July 16, 2015 Author Share Posted July 16, 2015 doesn't work 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 if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) cancelEvent() triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'police' ) end end ) Link to comment
darhal Posted July 16, 2015 Share Posted July 16, 2015 doesn't work 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 if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) cancelEvent() triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'police' ) end end ) 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 if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) return end end ) 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