[Help]Police Call
#4
(09-16-2014, 05:39 PM)xoft Wrote: Also, your AlertPol function is somewhat weird - it first checks if the number of parameters is inequal to 2, and if so, issues an error message. Then, although it knows that the number of parameters is 2, it still checks if it isn't equal to 1. There's no need for the "#Split ~= 1" condition.

I expect you want players to be able to send multi-word messages, too; in order for that to work, you should change the first condition to "#Split == 1" and then use "Message = table.concat(Split, " ", 2)" - this will take the Split table and join all items together with a space in between, starting with string #2.

This post was heaven in words, thanks!
Reply
Thanks given by:


Messages In This Thread
[Help]Police Call - by GeekSalt - 09-16-2014, 04:40 PM
RE: [Help]Police Call - by xoft - 09-16-2014, 05:34 PM
RE: [Help]Police Call - by xoft - 09-16-2014, 05:39 PM
RE: [Help]Police Call - by GeekSalt - 09-17-2014, 12:29 AM
RE: [Help]Police Call - by NiLSPACE - 09-17-2014, 12:30 AM
RE: [Help]Police Call - by GeekSalt - 09-17-2014, 12:48 AM



Users browsing this thread: 1 Guest(s)