isa_Khamdan Posted January 20, 2014 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.
Bonsai Posted January 20, 2014 Posted January 20, 2014 Try table.concat. The args gotta be ... e.g. function test(...) as far as I remember.
Castillo Posted January 20, 2014 Posted January 20, 2014 addCommandHandler ( "text", function ( player, _, ... ) local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then -- Do your thing here end end )
isa_Khamdan Posted January 20, 2014 Author Posted January 20, 2014 (edited) Deleted Edited January 20, 2014 by Guest
Castillo Posted January 20, 2014 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, _, ... )
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