• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

MysticSpirit 2.11pl2 String.explode doesn't work?

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


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 >.<)
 
1.i dont know mystic spirit so i cant help you with this question
2.I think there is no function to store it directly but u can make simple table in database `id`,`player_id` or `name` `x`,`y,`,z` etc... and db.executeQuery('UPDATE .........') and ('INSERT......') learn some sql it can be very helpfull
 
Back
Top