TheBot Posted October 17 Share Posted October 17 (edited) CLOSED Thanks I want help or idea, how to apply weapon property into a player not global.. I tried all Edited October 17 by TheBot Link to comment
Laxante101 Posted October 17 Share Posted October 17 SERVER SIDE function applyWeaponPropertiesToPlayer(player, weaponID) triggerClientEvent(player, "laxaevent", resourceRoot, weaponID) end addCommandHandler("setMP5Mode", function(player, command, mode) local weaponID = 29 -- MP5 if mode == "default" then applyWeaponPropertiesToPlayer(player, weaponID) elseif mode == "pro" then applyWeaponPropertiesToPlayer(player, weaponID) end end ) CLIENT SIDE addEvent("laxaevent", true) addEventHandler("laxaevent", root, function(weaponID) if weaponID == 29 then setWeaponProperty(29, "pro", "weapon_range", 100) setWeaponProperty(29, "pro", "target_range", 25) setWeaponProperty(29, "pro", "accuracy", 100) setWeaponProperty(29, "pro", "damage", 15) setWeaponProperty(29, "pro", "maximum_clip_ammo", 60) setWeaponProperty(29, "pro", "flag_type_dual", false) end end ) Since weapon properties are client-side only, you need to ensure that when reloading or switching weapons, the player retains the correct properties. This can be done using the 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