Jump to content

Some help


Scripting

Recommended Posts

Hi People,

I m making this comde for damage Ak-47 ,the problem the damage don t set to 30 in the player dead ,pls fix problem and thx

server-side:

addEventHandler ( "onClientPlayerWeaponFire",localPlayer,am)  
function am () 
setWeaponProperty(30, "pro", "damage", 999) 
end 
  
addEventHandler("onPlayerWasted", getRootElement(),re)  
function re () 
removeEventHandler("onClientPlayerWeaponFire", localPlayer,am) 
end 

Link to comment
setWeaponProperty 

is server side function.

But you use in client side :/

And also event onPlayerWasted is server side event, but you use in client side.

Your code full wrong.

Also you need attach handler to function at the bottom of the script.

You need understand:

Server side events ( onPlayerWasted, onPlayerSpawn, ... ) use only in server side.

Client side events ( onClientPlayerWasted, onClientPlayerSpawn, ... ) use only in client side.

Same thing with the functions ( There are exceptions, where you can use on the server and the client too ).

https://wiki.multitheftauto.com/wiki/Scr ... troduction

Edited by Guest
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...