Nexus-Quizes

From GMod Wiki

Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: The third party gamemode this page supports is dead
Last Edit was made on 11/16/2011
Placeholder.png

Quizes are, basically, the new "MOTD". Quizes are called when the player joins for the first time without any previous SQL entries on them in that scheme. To enable quizes simply add the following line of code into sh_auto.lua:

nexus.quiz.SetEnabled( true );

This enables quizes.

nexus.quiz.AddQuestion( "Do you agree to http://yoursite.com/rules/ ?", 1, "Yes.", "No." );

This creates a quiz option where the correct answer is Yes, as that is the first argument stated by the 1.

Answering too many questions incorrectly results in a kick.

Functions

nexus.quiz.SetEnabled( bool .boolean. )

Toggle the quiz.

nexus.quiz.GetName()

Returns the name of the quiz

nexus.quiz.GetEnabled()

Returns true if you have a quiz enabled.

nexus.quiz.SetName( Name .string. )

This sets the name of the current quiz.

nexus.quiz.GetQuestionsAmount()

This returns how many questions there are in your quiz.

nexus.quiz.GetQuestions()

This returns all quiz questions.

nexus.quiz.GetQuestion( index .tableindex. )

This gets the question from a specific table index in the nexus.quiz.stored table.

nexus.quiz.IsAnswerCorrect( index .tableindex., answer .string. )

This checks to see if the inputted string ( argument 2 ) matches the one in the table index specified ( argument 1 )

nexus.quiz.AddQuestion( question .string., answer .string., ... <answers> .string. )

This adds a question to the quiz

nexus.quiz.RemoveQuestion( question .tableindex. )

This removes the question from the quiz.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox