EvoGT Posted February 26, 2013 Posted February 26, 2013 (edited) Hello mta community, how to change weapon damage. Weapons are to strong for me, i need to make them with low damage. Edited February 26, 2013 by Guest
EvoGT Posted February 26, 2013 Author Posted February 26, 2013 Use setWeaponProperty. Thanks. Could yuo make an example? Im bad at scripting
DNL291 Posted February 26, 2013 Posted February 26, 2013 setWeaponProperty(weaponID, "poor", "damage", value) The 'value' argument is a number you want for the damage. The player must have the "poor" skill set to have the effect.
EvoGT Posted February 26, 2013 Author Posted February 26, 2013 Eh my bad english. That "poor" the skill? If i change the damage, and then shot to car, will it changes?
EvoGT Posted February 26, 2013 Author Posted February 26, 2013 I think nobody knows what i want : x okey. Like i shot with ak47 in to car, and destroy it in 10seconds, ( shoting until it burns) and i wanna make lower damage, and destroy like in 20secs
PaiN^ Posted February 26, 2013 Posted February 26, 2013 I didn't try it before, But i think it should ..
EvoGT Posted February 26, 2013 Author Posted February 26, 2013 setWeaponProperty(30, "poor", "damage", 1) i tryed , nothing changed i destroy car ( with ak47 in the same 10 sec time ) nothing changed. What to do ?
EvoGT Posted February 26, 2013 Author Posted February 26, 2013 Rly, nobody understands me Heres what im trying to do: I wanna make Ak47 damage lower. Becouse, when i shot with ak47 into vehicle, it blows too fast. is it possible to make damage lower when i shotting to vehicles
50p Posted February 26, 2013 Posted February 26, 2013 I guess you don't read what people tell you. There is only 1 function that will change weapon's properties and it's setWeaponProperty. If you want the property to be changeable depending on its target then you will have to getPedTarget and check if it's specific type of element (or you can use onPlayerTarget) and then change player's weapon skill level. setWeaponProperty will change weapon's property for all players, if you change it client-side it may cause trouble for other players, so this is why you should change weapon's property for specific level and then change player's level depending on what he's aiming at.
EvoGT Posted February 26, 2013 Author Posted February 26, 2013 I guess you don't read what people tell you. There is only 1 function that will change weapon's properties and it's setWeaponProperty. If you want the property to be changeable depending on its target then you will have to getPedTarget and check if it's specific type of element (or you can use onPlayerTarget) and then change player's weapon skill level. setWeaponProperty will change weapon's property for all players, if you change it client-side it may cause trouble for other players, so this is why you should change weapon's property for specific level and then change player's level depending on what he's aiming at. Well, i talking not about aiming. I talking about this : https://community.multitheftauto.com/ind ... ls&id=5711 And i tryed, setWeaponProperty(30, "poor", "damage", 1) But it dont work
Moderators IIYAMA Posted February 26, 2013 Moderators Posted February 26, 2013 50P change player's weapon skill level setWeaponProperty(30, "pro", "damage", 1) setWeaponProperty(30, "std", "damage", 1) setWeaponProperty(30, "poor", "damage", 1) -- "poor","std" and "pro" The reason why it did not work in the first place is that all weapons in freeroam(probably) start with differed skill levels. When you change the weapon damage, it will also change the damage vs peds and players. It is possible to reduce it without change the default value, but that will require much and much more scripting skills. I made it, but of course I won't give it to you, because it cost me lots of time.
Xwad Posted April 12, 2015 Posted April 12, 2015 ok i made it but itw not wroking:( pls help function giveAmmo ( thePlayer, theVehicle, theTeam ) if (getElementModel(source) == 433) then giveWeapon ( source, 31, 200 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), giveAmmo )
ViPeR- Posted April 12, 2015 Posted April 12, 2015 ok i made it but itw not wroking:( pls help function giveAmmo ( thePlayer, theVehicle, theTeam ) if (getElementModel(source) == 433) then giveWeapon ( source, 31, 200 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), giveAmmo ) Of course it's not working , open the wiki page of onPlayerVehicleEnter and see what is the source of this event.
yesyesok Posted April 12, 2015 Posted April 12, 2015 ok i made it but itw not wroking:( pls help function giveAmmo ( thePlayer, theVehicle, theTeam ) if (getElementModel(source) == 433) then giveWeapon ( source, 31, 200 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), giveAmmo ) Why are you bumping an old topic and posting your problem?
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