isa_Khamdan Posted January 20, 2014 Share Posted January 20, 2014 Hello , I want to make a command like this ( Command Text ) so I made this function ( player, _, text ) it's working but the problem is that if the player type spaces between the text it will only take the first part before the space and ignore the rest so how can I solve this? Edit: i want it Just like the original " Say " command in MTA. Link to comment
Bonsai Posted January 20, 2014 Share Posted January 20, 2014 Try table.concat. The args gotta be ... e.g. function test(...) as far as I remember. Link to comment
isa_Khamdan Posted January 20, 2014 Author Share Posted January 20, 2014 anyone else? Link to comment
Castillo Posted January 20, 2014 Share Posted January 20, 2014 addCommandHandler ( "text", function ( player, _, ... ) local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then -- Do your thing here end end ) Link to comment
isa_Khamdan Posted January 20, 2014 Author Share Posted January 20, 2014 (edited) Deleted Edited January 20, 2014 by Guest Link to comment
Castillo Posted January 20, 2014 Share Posted January 20, 2014 function ( player, _, "nick" ) What is that "nick"? you didn't even read my example or what? it has to be: function ( player, _, ... ) Link to comment
isa_Khamdan Posted January 20, 2014 Author Share Posted January 20, 2014 Thanks a lot it's working 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