Jump to content

Change weapon damage [DELETE]


EvoGT

Recommended Posts

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.

Link to comment
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

Link to comment
  • Moderators

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.

Link to comment
  • 2 years later...

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 ) 
  

Link to comment
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.

Link to comment
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?
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...