Albanon
New Member
- Joined
- Mar 5, 2011
- Messages
- 93
- Reaction score
- 1
I'm trying to learn how to script but it isn't going so well. Here's my code so far. All it's supposed to do is help me to test whether or not I have succeeded in using string.explode correctly...it works in other releases but not in mystic spirit for some reason.
Here's what I want to know.
1: Why doesn't this work in mystic spirit. Is there an equivalent way to do what I'm attempting to?
2: Are there any functions that allow me to store a players position? I'm attempting to allow players to "mark" locations they want to be able to teleport back to later.
3: If anyone is interested in teaching me more about scripting, or making themselves available for me to ask questions to over chat or something, I'll happily provide them with working copies of my future scripting successes =p Thanks in advance
(this code was supplied to me by another individual, however, my attempts at it arrived at a very similar conclusion. Just to give credit where credit is due..forgot his name though >.<)
Here's what I want to know.
1: Why doesn't this work in mystic spirit. Is there an equivalent way to do what I'm attempting to?
2: Are there any functions that allow me to store a players position? I'm attempting to allow players to "mark" locations they want to be able to teleport back to later.
3: If anyone is interested in teaching me more about scripting, or making themselves available for me to ask questions to over chat or something, I'll happily provide them with working copies of my future scripting successes =p Thanks in advance
PHP:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
if t[1] == "one" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "One")
elseif t[1] == "two" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Two")
end
return true
end
(this code was supplied to me by another individual, however, my attempts at it arrived at a very similar conclusion. Just to give credit where credit is due..forgot his name though >.<)