Negriukas Posted August 20, 2014 Posted August 20, 2014 Hello, I'm trying to fix some weapons range by writing this simple script, anyway is it safe like this way? server: --FIXING WEAPON PROPERTIES function setWeaponAutomaticRangeFixOn() rangeProperty = { {"M4", 31, "pro", "weapon_range", 200}, {"M4", 31, "std", "weapon_range", 150}, {"M4", 31, "poor", "weapon_range", 90}, {"SNIPER", 34, "pro", "weapon_range", 500}, {"SNIPER", 34, "std", "weapon_range", 300}, {"SNIPER", 34, "poor", "weapon_range", 200}, {"AK47", 30, "pro", "weapon_range", 200}, {"AK47", 30, "std", "weapon_range", 150}, {"AK47", 30, "poor", "weapon_range", 90}, } for i,v in ipairs( rangeProperty ) do local weaponID = v[2] local weaponSkill = v[3] local weaponProperty = v[4] local weaponValue = v[5] for i = 1,9 do setWeaponProperty(weaponID, weaponSkill, weaponProperty, weaponValue) end end end function startTheResource() setWeaponAutomaticRangeFixOn() end addEventHandler("onResourceStart", getRootElement(), startTheResource)
WASSIm. Posted August 20, 2014 Posted August 20, 2014 --FIXING WEAPON PROPERTIES local rangeProperty = { {"M4", 31, "pro", "weapon_range", 200}, {"M4", 31, "std", "weapon_range", 150}, {"M4", 31, "poor", "weapon_range", 90}, {"SNIPER", 34, "pro", "weapon_range", 500}, {"SNIPER", 34, "std", "weapon_range", 300}, {"SNIPER", 34, "poor", "weapon_range", 200}, {"AK47", 30, "pro", "weapon_range", 200}, {"AK47", 30, "std", "weapon_range", 150}, {"AK47", 30, "poor", "weapon_range", 90}, } function setWeaponAutomaticRangeFixOn() for i,data in ipairs( rangeProperty ) do local id, skill, property, value = unpack(data) setWeaponProperty(id, skill, property, value) end end addEventHandler("onResourceStart", getRootElement(), setWeaponAutomaticRangeFixOn)
Negriukas Posted August 20, 2014 Author Posted August 20, 2014 --FIXING WEAPON PROPERTIES local rangeProperty = { {"M4", 31, "pro", "weapon_range", 200}, {"M4", 31, "std", "weapon_range", 150}, {"M4", 31, "poor", "weapon_range", 90}, {"SNIPER", 34, "pro", "weapon_range", 500}, {"SNIPER", 34, "std", "weapon_range", 300}, {"SNIPER", 34, "poor", "weapon_range", 200}, {"AK47", 30, "pro", "weapon_range", 200}, {"AK47", 30, "std", "weapon_range", 150}, {"AK47", 30, "poor", "weapon_range", 90}, } function setWeaponAutomaticRangeFixOn() for i,data in ipairs( rangeProperty ) do local id, skill, property, value = unpack(data) setWeaponProperty(id, skill, property, value) end end addEventHandler("onResourceStart", getRootElement(), setWeaponAutomaticRangeFixOn) Same thing, + It works fine i just asked if it's okay like that... Can you write something useful in stead of spamming to increase the number of posts...
Gr0x Posted August 21, 2014 Posted August 21, 2014 He cleaned it up, which is useful. You should say thanks to that guy instead of complaining. Btw yeah, it's okay.
-.Paradox.- Posted August 21, 2014 Posted August 21, 2014 (edited) He cleaned it up, which is useful.You should say thanks to that guy instead of complaining. Btw yeah, it's okay. He didn't clean it up lol, Read Wassim's code again.. compare this {"AK47", 30, "pro", "weapon_range", 200} with this (id, skill, property, value) so basically id = ak47, skill = 30, property = pro, value weapon_range? that's why franklin deifned them here local weaponID = v[2] local weaponSkill = v[3] local weaponProperty = v[4] local weaponValue = v[5] Edited August 21, 2014 by Guest
Moderators IIYAMA Posted August 21, 2014 Moderators Posted August 21, 2014 Hello, I'm trying to fix some weapons range by writing this simple script, anyway is it safe like this way? To answer your main question, Yes it is.
Negriukas Posted August 21, 2014 Author Posted August 21, 2014 Hello, I'm trying to fix some weapons range by writing this simple script, anyway is it safe like this way? To answer your main question, Yes it is. Thanks.
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