Jump to content

[HELP]How To Give Weapon


Recommended Posts

local Skinmarker = createMarker(931.40002441406, -1030.9000244141, 30.89999961853, "cylinder", 1.5, 33, 33, 33, 255) -- umkleide 
local theTeam = createTeam( "FBI", 31, 31, 31 ) 
  
addEventHandler("onMarkerHit", Skinmarker, 
function(hitElement) 
    if(isPedInVehicle(hitElement)) then return end 
    if not(isFBI(hitElement)) then return end 
    setElementModel(hitElement, 286) 
        setPlayerTeam(hitElement, theTeam) 
end) 
function isFBI(thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) )  
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "FBI" ) ) then 
        return true; 
    else 
        return false; 
    end 
end  

how to give weapon here?

Link to comment
local Skinmarker = createMarker ( 931.40002441406, -1030.9000244141, 30.89999961853, "cylinder", 1.5, 33, 33, 33, 255 ) -- umkleide 
local theTeam = createTeam ( "FBI", 31, 31, 31 ) 
  
addEventHandler ( "onMarkerHit", Skinmarker, 
    function ( hitElement ) 
        if ( isPedInVehicle ( hitElement ) ) then  
            return 
        end 
  
        if ( not isFBI ( hitElement ) ) then  
            return 
        end 
  
        setElementModel ( hitElement, 286 ) 
        setPlayerTeam ( hitElement, theTeam ) 
        giveWeapon ( hitElement, 29, 500, true ) -- Give him a MP5 with 500 bullets and set it as current weapon. 
    end 
) 
  
function isFBI ( thePlayer ) 
    if ( not thePlayer ) then 
        return false 
    end 
  
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    return isObjectInACLGroup ("user."..accName, aclGetGroup ( "FBI" ) ) 
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...