- Joined
- Jan 14, 2013
- Messages
- 19
- Reaction score
- 0
For the record, tibia doesn't mean bone in Latin...
For the record, tibia doesn't mean bone in Latin...
ThanksTibia seems to have used a lot of different type of bones in names for cities etc.
Tibia = lower leg bone (shin bone)
Fibula = lower leg bone
Mt. sternum = chest bone attached to ribs
Femur = upper leg bone (thigh bone)
xd
Tibia itself does not mean bone. It IS a bone
- - - Updated - - -
- nice work anyway
Hello , i've made some changes on your script and made it ontimer + changed item from prize to id prize etc but i got problem when i answer the question with correct answer and receive my reward till now its working fine but when i answer this question with another player or with main one the script keep telling me that (This answer is wrong) but i already answered it and received my reward ,the script must tell me that (The quiz has already ended) but this isn't workingHere's my pop quiz script. There's a question drawn, and the first person who answers the question gets the prize.
If you know any questions I could add, post them with comments!
/mods/popquiz.xml
Lua:<?xml version = "1.0" encoding = "UTF-8"?> <mod name = "Pop quiz" version = "1.0" author = "Teckman" enabled = "yes"> <config name = "config"><![CDATA[ config = { questions = { [1] = {question = "What is 'tibia' in latin?", answer = "bone"}, [2] = {question = "What is the incantation for rage of the skies spell?", answer = "exevo gran mas vis"}, [3] = {question = "How much health has a rotworm?", answer = "65"}, [4] = {question = "When was tibia created?", answer = "1997"}, [5] = {question = "How much attack has magic sword?", answer = "48"}, [6] = {question = "How many feet toes has a cyclops?", answer = "7"}, [7] = {question = "What type of item requires soul to be created?", answer = "rune"}, [8] = {question = "How many elements are in tibia?", answer = "6"}, [9] = {question = "How many professions are in tibia?", answer = "4"}, [10] = {question = "How much gold does promotion cost?", answer = "20000"}, [11] = {question = "What is the name of the current king?", answer = "tibianus"}, [12] = {question = "What is the name of the 'pyramid city'?", answer = "ankrahmun"}, [13] = {question = "How many pharaos exist in tibia?", answer = "9"}, }, prize = 50000, -- if you want a random number just add for example {50, 20000} storage = 400 } ]]></config> <globalevent name="popquiz" interval="20" event="script"><![CDATA[ domodlib("config") function onThink(interval) setGlobalStorageValue(cid, config.storage, config.questions[math.random(1, table.maxn(config.questions))].question) doBroadcastMessage("[POP QUIZ]: " .. getGlobalStorageValue(config.storage) .. " - to answer the question type '/quiz ANSWER'.", MESSAGE_EVENT_ADVANCE) return true end ]]></globalevent> <talkaction words = "/quiz" event = "script"><![CDATA[ domodlib("config") function onSay(cid, words, param) if(param) then if(getGlobalStorageValue(config.storage)) then for _, v in pairs(config.questions) do if(v.question == getGlobalStorageValue(config.storage)) then if(string.lower(param) == v.answer) then doBroadcastMessage("[POP QUIZ]: " .. getPlayerName(cid) .. " has answered the question: " .. v.question .. ", with answer: " .. v.answer .. ". Congratulations to the winner!", MESSAGE_EVENT_ADVANCE) doPlayerAddMoney(cid, type(config.prize) == "table" and math.random(config.prize[1], config.prize[2]) or config.prize setGlobalStorageValue(config.storage, nil) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) return true end end end else doPlayerSendCancel(cid, "The quiz has already ended.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return true end else doPlayerSendCancel(cid, "The answer must be stated in parameter.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return true end doPlayerSendCancel(cid, "This answer is wrong.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return true end ]]></talkaction> </mod>
<?xml version = "1.0" encoding = "UTF-8"?>
<mod name = "Pop quiz" version = "1.0" author = "Teckman" enabled = "yes">
<config name = "config"><![CDATA[
config = {
questions = {
[1] = {question = "What is 'tibia' in latin?", answer = "bone"},
[2] = {question = "What is the incantation for rage of the skies spell?", answer = "exevo gran mas vis"},
[3] = {question = "How much health has a rotworm?", answer = "65"},
[4] = {question = "When was tibia created?", answer = "1997"},
[5] = {question = "How much attack has magic sword?", answer = "48"},
[6] = {question = "How many feet toes has a cyclops?", answer = "7"},
[7] = {question = "What type of item requires soul to be created?", answer = "rune"},
[8] = {question = "How many elements are in tibia?", answer = "6"},
[9] = {question = "How many professions are in tibia?", answer = "4"},
[10] = {question = "How much gold does promotion cost?", answer = "20000"},
[11] = {question = "What is the name of the current king?", answer = "tibianus"},
[12] = {question = "What is the name of the 'pyramid city'?", answer = "ankrahmun"},
[13] = {question = "How many pharaos exist in tibia?", answer = "9"},
},
storage = 400
}
]]></config>
<globalevent name="popquiz" time="01:55" event="script"><![CDATA[
domodlib("config")
function onTimer()
setGlobalStorageValue(cid, config.storage, config.questions[math.random(1, table.maxn(config.questions))].question)
doBroadcastMessage("[POP QUIZ]: " .. getGlobalStorageValue(config.storage) .. " - to answer the question type '/quiz ANSWER'.", MESSAGE_EVENT_ADVANCE)
return true
end
]]></globalevent>
<talkaction words = "/quiz" event = "script"><![CDATA[
domodlib("config")
function onSay(cid, words, param)
if(param) then
if(getGlobalStorageValue(config.storage)) then
for _, v in pairs(config.questions) do
if(v.question == getGlobalStorageValue(config.storage)) then
if(string.lower(param) == v.answer) then
doBroadcastMessage("[POP QUIZ]: " .. getPlayerName(cid) .. " has answered the question: " .. v.question .. ", with answer: " .. v.answer .. ". Congratulations to the winner!", MESSAGE_EVENT_ADVANCE)
doPlayerAddItem(cid, 2160, 10) --adds 1 crystal coin <--------------------- added this
setGlobalStorageValue(config.storage, nil)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
return true
end
end
end
elseif setGlobalStorageValue(config.storage, nil) then <------------------------ added this
doPlayerSendCancel(cid, "The quiz has already ended.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
else
doPlayerSendCancel(cid, "The answer must be stated in parameter.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
doPlayerSendCancel(cid, "This answer is wrong.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
]]></talkaction>
</mod>
thx :*Probably easy fix, I'll look at it when I get home