GamerDeMTA Posted August 29, 2013 Posted August 29, 2013 So this is a mess for me. What's for example the difference between player, source, ?? And when do I put things like this: function ( source ) --... end
Castillo Posted August 29, 2013 Posted August 29, 2013 There's no "difference", since you can use your own names instead of "player" you can put "monkey" and it would still work as long as you use "monkey". 'source' is defined by MTA, used for events.
GamerDeMTA Posted August 30, 2013 Author Posted August 30, 2013 but in some functions i use see: this doesnt work function test ( ) this works function test ( source )
Moderators IIYAMA Posted August 30, 2013 Moderators Posted August 30, 2013 Define source as argument isn't very smart. Source only gets created by events as solidsnake said. A addCommandHandler don't have any source if you using it. server side addCommandHanlder("test", function (player) end) -- VS -- addEventHandler("onPlayerWasted",root, function() local player = source end)
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