Jump to content

Help Me [Weapon Problem]


undefined

Recommended Posts

1. You can make your own weapon system (you can make your own binds, then when bind getElementData if he have gun and give it to him, or smthing similiar.

2. Try to use this script:

addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), -- adding an event handler for onplayerweaponswitch 
    function ( previousWeaponID, currentWeaponID ) 
        if previousWeaponID == 22 and getElementData(source, "deagle") == true then -- checking if previous weapon was colt and giving dgl 
            giveWeapon(source, 24, 30)  -- giving playah a dgl   
        end 
        if previousWeaponID == 24 and getElementData(source, "colt") == true then -- checking if previous weapon was dgl and giving colt 
            giveWeapon(source, 22, 30) -- giving playah a colt 
        end 
    end 
) 
function givePlayerAGun (who, cmd, agun) 
-- 'gun' argument: 1 - colt, 2 - deagle 
    outputChatBox("YOU EXECUTED: "..tostring(cmd), who) 
    if agun == "1" then 
        giveWeapon(who, 22, 30, true) -- giving playah a colt 
        setElementData(who, "colt", true) -- element data fun, i think there is other idea to do it, think 
    elseif agun == "2" then 
        giveWeapon(who, 24, 30, true)  -- giving playah a dgl 
        setElementData(who, "deagle", true) -- element data fun, i think there is other idea to do it, think 
    end 
end 
addCommandHandler ( "givemeagun", givePlayerAGun )-- command giving a weapon, use /givemeagun 1 or /givemeagun2 

It works but its just basic, you need to do some shit client-side also to get ammo and recover it, blah blah :) It works as it should.

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