proracer Posted January 27, 2011 Posted January 27, 2011 -- Easy maths mathTableEasy = {} mathTableEasy[1] = "2 + 2 = ?" mathTableEasy[2] = "5 * 5 = ?" mathTableEasy[3] = "8 / 2 = ?" mathTableEasy[4] = "10 - 5 = ?" mathTableEasy[5] = "19 + 10 = ?" mathTableEasy[6] = "24 * 5 = ?" mathTableEasy[7] = "120 / 5 = ?" mathTableEasy[8] = "127 - 69 = ?" mathTableEasy[9] = "11 * 11 = ?" mathTableEasy[10] = "108 / 9 = ?" -- Mediocre maths mathTableMedium = {} mathTableMedium[1] = "39 + 28 = ?" mathTableMedium[2] = "43 - 52 = ?" mathTableMedium[3] = "29 * 6 = ?" mathTableMedium[4] = "240 / 15 = ?" mathTableMedium[5] = "Pi = ?" mathTableMedium[6] = "2 ^ 8 = ?" mathTableMedium[7] = "3 ^ 4 = ?" mathTableMedium[8] = "582 - 334 = ?" mathTableMedium[9] = "392 + 382 = ?" mathTableMedium[10] = "125 * 3 = ?" -- Hard maths mathTableHard = {} mathTableHard[1] = "3921 + 192 = ?" mathTableHard[2] ="2912 - 585 = ?" mathTableHard[3] = "273 * 4 = ?" mathTableHard[4] = "384 / 4 = ?" mathTableHard[5] = "Square root of 625 = ?" mathTableHard[6] = "Square root of 121 = ?" mathTableHard[7] = "Square root of 196 = ?" mathTableHard[8] = "Square root of 289 = ?" mathTableHard[9] = "100 ^ 3 = ?" mathTableHard[10] = "19295 + (-123 * 4) = ?" function mathQuestions(message, messageType) outputChatBox(tostring(mathTableEasy[1]), getRootElement(), 0, 91, 255) if messageType == 0 and message == "4" then outputChatBox("Correct!") else outputChatBox("Incorrect!") end end addEventHandler("onPlayerChat", getRootElement(), mathQuestions) It won't output message to the chatbox.
Castillo Posted January 27, 2011 Posted January 27, 2011 here it works, it outputs: [MM]Castillo: 4 2 + 2 = ? Correct! [MM]Castillo: 5 2 + 2 = ? Incorrect! [MM]Castillo: 8 2 + 2 = ? Incorrect!
proracer Posted January 27, 2011 Author Posted January 27, 2011 Sorry, I wanted to express the other way around. It should be vice-versa.First it should output message ' 2 + 2 = ? ' and if you type '4' it should say 'Correct!' EDIT: I have fixed it. -- Easy maths mathTableEasy = {} mathTableEasy[1] = "2 + 2 = ?" mathTableEasy[2] = "5 * 5 = ?" mathTableEasy[3] = "8 / 2 = ?" mathTableEasy[4] = "10 - 5 = ?" mathTableEasy[5] = "19 + 10 = ?" mathTableEasy[6] = "24 * 5 = ?" mathTableEasy[7] = "120 / 5 = ?" mathTableEasy[8] = "127 - 69 = ?" mathTableEasy[9] = "11 * 11 = ?" mathTableEasy[10] = "108 / 9 = ?" -- Mediocre maths mathTableMedium = {} mathTableMedium[1] = "39 + 28 = ?" mathTableMedium[2] = "43 - 52 = ?" mathTableMedium[3] = "29 * 6 = ?" mathTableMedium[4] = "240 / 15 = ?" mathTableMedium[5] = "Pi = ?" mathTableMedium[6] = "2 ^ 8 = ?" mathTableMedium[7] = "3 ^ 4 = ?" mathTableMedium[8] = "582 - 334 = ?" mathTableMedium[9] = "392 + 382 = ?" mathTableMedium[10] = "125 * 3 = ?" -- Hard maths mathTableHard = {} mathTableHard[1] = "3921 + 192 = ?" mathTableHard[2] ="2912 - 585 = ?" mathTableHard[3] = "273 * 4 = ?" mathTableHard[4] = "384 / 4 = ?" mathTableHard[5] = "Square root of 625 = ?" mathTableHard[6] = "Square root of 121 = ?" mathTableHard[7] = "Square root of 196 = ?" mathTableHard[8] = "Square root of 289 = ?" mathTableHard[9] = "100 ^ 3 = ?" mathTableHard[10] = "19295 + (-123 * 4) = ?" function mathQuestion() outputChatBox(tostring(mathTableEasy[1]), getRootElement(), 0, 91, 255) end function mathAnswer(message, messageType) if messageType == 0 and message == "4" then outputChatBox("Correct!") else outputChatBox("Incorrect!") end end addEventHandler("onPlayerChat", getRootElement(), mathAnswer) addEventHandler("onResourceStart", getRootElement(), mathQuestion) P.S. Really stupid
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