GamerDeMTA Posted August 29, 2013 Share 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 Link to comment
Castillo Posted August 29, 2013 Share 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. Link to comment
GamerDeMTA Posted August 30, 2013 Author Share Posted August 30, 2013 but in some functions i use see: this doesnt work function test ( ) this works function test ( source ) Link to comment
Moderators IIYAMA Posted August 30, 2013 Moderators Share 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) Link to comment
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