undefined Posted April 8, 2014 Share Posted April 8, 2014 Hi Guys! I have a problem. I bought "colt-45". Then the I bought "deagle". But when i get deagle, "colt-45" was destroyed. How to fix this problem? Link to comment
monumento Posted April 8, 2014 Share Posted April 8, 2014 So, you want to have two weapons from one type at the same time? Try this on(Client)PlayerWeaponSwitch Link to comment
gghvcffcv Posted April 8, 2014 Share Posted April 8, 2014 i think MTA doesn't allows you to get Colt45 and Deagle at the Same time. Link to comment
monumento Posted April 9, 2014 Share Posted April 9, 2014 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
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