Raised This Month: $51 Target: $400
 12% 

Trivia


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 17:35   Trivia
Reply With Quote #1

Ok this is one for AJAX

I'm looking for an events script that can, when people die whisper the question to them, and this happens for each player in turn, (same question) and then the first correct answer gets a cash reward.

I know how to do the player death whispering, the cash reward, however selecting a question from a text file or database and the answer bit I don't have a clue.

So ajax can you help me make this?
Nat
volmasoft is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 17:51  
Reply With Quote #2

okay first of all i don't see why this question is ajax-restricted, but thanks for the shout out. i don't want the responsibility of answering all questions

some people have done something similar before (random selection) but i don't remember the threads. basically you use es_rand to generate a random number. then...

Quote:
(this is not code)
if number=1, then question=question1, answer=answer1
if number=2, then question=question1, answer=answer2
if number=3, then question=question1, answer=answer3
etc.
you'll have to write this out explicitly, so no drawing from a database. but the cfg file running this code would essentially serve as your database.
ajax is offline
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 17:52  
Reply With Quote #3

AHA cheers ajax
volmasoft is offline
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 17:54  
Reply With Quote #4

What do you mean by "this is not the code" ?? I understand it though and how to write it (I think)

I'm guessing this will have to be a script pack as I need to use the player_say.cfg to get the answers?
volmasoft is offline
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 18:01  
Reply With Quote #5

I've got this:
random_question.cfg
Code:
setinfo questionnum 0
es_rand questionnum 1 2

// Question
if (rsoundnum equalto 1) then es_setinfo question how do you spell hello? 
if (rsoundnum equalto 1) then es_setinfo answer hello 
if (rsoundnum equalto 2) then es_setinfo question Does this work?
if (rsoundnum equalto 2) then es_setinfo answer dunno
I'm unsure whether the question and answer variables are set correctly, can you tell me Ajax? Do they have to be in quotation marks?
Nat
volmasoft is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 18:04  
Reply With Quote #6

Quote:
Originally Posted by volmasoft
What do you mean by "this is not the code" ?? I understand it though and how to write it (I think)
i mean if it was code it would look something like this
Code:
//sample code
if (server_var(my_random_number) equalto 3) then es_setinfo my_question_text "how smart is ichy? (a) not very (b) not very (c) not very (d) all of the above"
if (server_var(my_random_number) equalto 3) then es_setinfo my_answer_text "d"
Quote:
I'm guessing this will have to be a script pack as I need to use the player_say.cfg to get the answers?
nothing ever really NEEDS to be a script pack. script packs just allow for easier installation and will work no matter what eventscript_subdirectory is set to.
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-26-2005 , 18:10  
Reply With Quote #7

An Idea of how to make it more complicated; The more answers they get right the harder they get!
__________________
ichthys is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 18:16  
Reply With Quote #8

Quote:
Originally Posted by volmasoft
I've got this:
random_question.cfg
Code:
setinfo questionnum 0
es_rand questionnum 1 2

// Question
if (rsoundnum equalto 1) then es_setinfo question how do you spell hello? 
if (rsoundnum equalto 1) then es_setinfo answer hello 
if (rsoundnum equalto 2) then es_setinfo question Does this work?
if (rsoundnum equalto 2) then es_setinfo answer dunno
I'm unsure whether the question and answer variables are set correctly, can you tell me Ajax? Do they have to be in quotation marks?
Nat
well rsoundnum should be server_var(questionnum) but other than that i'm not sure about the quotation marks.

you could also do something like this
Code:
// here's your database
es_setinfo question1 "blah?"
es_setinfo answer1 "blah"
es_setinfo question2 "blah blah?"
es_setinfo answer2 "blah blah"
es_setinfo question3 "blah blah blah?"
es_setinfo answer3 "blah blah blah"
Code:
// references your database
if (server_var(questionnum) equalto 1) then es_setinfo question server_var(question1)
if (server_var(questionnum) equalto 1) then es_setinfo answer server_var(answer1)
actually you could token your questionnum # into your server_var(question#) if your database is huge, but that's more advanced.
ajax is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 18:18  
Reply With Quote #9

Quote:
Originally Posted by ichthys
An Idea of how to make it more complicated; The more answers they get right the harder they get!
yeah i guess the sample question i used as an example is pretty easy.
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-26-2005 , 18:27  
Reply With Quote #10

Quote:
Originally Posted by ajax
Quote:
Originally Posted by ichthys
An Idea of how to make it more complicated; The more answers they get right the harder they get!
yeah i guess the sample question i used as an example is pretty easy.
I can think of an even easier one

Whenever a player is asked a question, you should store the answer in a userid specific cvar.


edit: nvm
__________________
ichthys is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode