Jump to content

#setWeaponProperty


SycroX

Recommended Posts

hello guys. i want to create a levels for weapons. i've created it and it's work well exept 2 weapons the sniper and the rifle

idk why buy when i use setWeaponProperty with any weapons it works but when i use it with sniper and rifle nothing happen and the properties of all levels pro - std - poor

set to poor that's a simple code for my problem

setPedStat to change player weaponSkills

the stat of sniper is 79

addEventHandler("onResourceStart", resourceRoot,
  	function()
		setWeaponProperty("sniper", "pro", "damage", 130)
		setWeaponProperty("sniper", "pro", "accuracy", 1)
		setWeaponProperty("sniper", "pro", "flag_move_and_shoot", true)
		setWeaponProperty("sniper", "pro", "target_range", 350)
		setWeaponProperty("sniper", "pro", "weapon_range", 400)
		--
		setWeaponProperty("sniper", "std", "damage", 130)
		setWeaponProperty("sniper", "std", "accuracy", 1)
		setWeaponProperty("sniper", "std", "flag_move_and_shoot", true)
		setWeaponProperty("sniper", "std", "target_range", 350)
		setWeaponProperty("sniper", "std", "weapon_range", 400)
		--
		setWeaponProperty("sniper", "poor", "damage", 130)
		setWeaponProperty("sniper", "poor", "accuracy", 1)
		setWeaponProperty("sniper", "poor", "flag_move_and_shoot", true)
		setWeaponProperty("sniper", "poor", "target_range", 350)
		setWeaponProperty("sniper", "poor", "weapon_range", 400)
   	end
)

 

Edited by #x1AhMeD,-09
Link to comment

i've tried many ways but the result it same .. 

* Note : all weapons are worked exept the sniper and the rifle .. - the code is working with the other weapons

this is another way

addEventHandler("onPlayerWeaponSwitch", root,
	function(_, curWep)
		if curWep == 34 then
            local stat = getPedStat(source, 79)
            if stat < 300 then
				setWeaponProperty(34, "poor", "damage", 1000)
            elseif stat >= 300 and stat < 999 then
				setWeaponProperty(34, "std", "damage", 500)
            elseif stat >= 999  then
				setWeaponProperty(34, "pro", "damage", 100)
            end	
		end
	end
)

+ i've created a code to check the result but the result always same

addCommandHandler("wep",
	function(player,_,id,s,p)
			local id = tonumber(id)
			outputChatBox("Original : "..getOriginalWeaponProperty(id, tostring(s), tostring(p)), player)
			outputChatBox("Current : "..getWeaponProperty(id, tostring(s), tostring(p)), player)
	end
)

 

Edited by #x1AhMeD,-09
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...