Jump to content

Group types


TheSmart

Recommended Posts

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

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

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

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

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

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