Raised This Month: $ Target: $400
 0% 

Trivia


Post New Thread Reply   
 
Thread Tools Display Modes
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 18:27  
Reply With Quote #11

Ok here's my starting blocks that i've made so far, i'm trying to get my head around eventscripts still remember though so any bugs please report ;)

(btw ajax I corrected the variables, that was just adapting some previous coding;))

Ok here goes: (all in a script pack)
player_say.cfg
Code:
// Trivia commands
if (event_var(text) equalto "trivia") then es_msg #lightgreen Trivia version 0.1.0 is active, you will be asked a question when you die ,the first correct answer wins a cash prize.

// Remind the user of the trivia question
if (event_var(text) equalto "question") then es_tell event_var(userid) #lightgreen The trivia question is: server_var(question)

// If the question is answered correctly, tell the user directly and give cash reward.
if (event_var(text) equalto server_var(question)) then es_tell event_var(userid) #yellow CORRECT ANSWER!!!
if (event_var(text) equalto server_var(question)) then ma_givecash event_var(userid) server_var(difficulty)

// Once the question has been answered tell everyone else.
if (event_var(text) equalto server_var(question)) then es_msg #lightgreen The Answer was: server_var(answer), the person who answered it was event_var(userid) and the cash prize rewarded was: 

// Clear the answer variable to stop people answering after the first person.
if (event_var(text) equalto server_var(question)) then es_setinfo answer abcdefghijklmnopqrstuvwxyz1234567890
player_death.cfg
Code:
es_tell event_var(userid) #lightgreen The trivia question is: server_var(question)
random_question.cfg
Code:
setinfo questionnum 0
es_rand questionnum 1 3

// Questions
if (questionnum equalto 1) then es_setinfo question how do you spell hello? 
if (questionnum equalto 1) then es_setinfo answer hello 
if (questionnum equalto 1) then es_setinfo difficulty 500 
if (questionnum equalto 2) then es_setinfo question What is 2 plus 2 times 5 divided by 2
if (questionnum equalto 2) then es_setinfo answer 10
if (questionnum equalto 2) then es_setinfo difficulty 500
if (questionnum equalto 3) then es_setinfo question What is es?
if (questionnum equalto 3) then es_setinfo answer eventscripts
if (questionnum equalto 3) then es_setinfo difficulty 1500
volmasoft is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 18:39  
Reply With Quote #12

(By the way, I just want to chime in here to state that I think this is a really neat script idea.)
Mattie is offline
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 18:45  
Reply With Quote #13

Cheers mattie, found any bugs?
volmasoft is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-26-2005 , 18:47  
Reply With Quote #14

Well done.

But I think your missing the line to exec random_question.cfg! Could be in either round_start.cfg or round_end.cfg!
edit: or you could just change random_question.cfg to round_start.cfg/round_end.cfg

Another thing, you wouldn't want anyone to find out what your default answer is!!! ie. abcdefghij.......890. I suggest es_xsetinfo answer "" because a player cant say nothing!

Also.....(last thing i promise, bet ajax's response will be faster than mine lol)
any line that has es or es_ at the beginning will not need es_ for any of the other commands down the like. This will help with performance.
e.g. Instead of:
Code:
if (event_var(text) equalto server_var(question)) then es_tell event_var(userid) #yellow CORRECT ANSWER!!!
Just use:
Code:
if (event_var(text) equalto server_var(question)) then es_xtell event_var(userid) #yellow CORRECT ANSWER!!!
Oh, and I didn't know #yellow was a color in ES?
__________________
ichthys is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 18:51  
Reply With Quote #15

Quote:
Originally Posted by Mattie
(By the way, I just want to chime in here to state that I think this is a really neat script idea.)
i agree. the reason why i started looking into betting scripts was to create things for dead players to do... a mini game of sorts. this is similar.

btw here's something i could use and maybe volmasoft could use it too... es_msg_deadonly
ajax is offline
McBain
Member
Join Date: May 2004
Old 05-26-2005 , 18:54  
Reply With Quote #16

It sounds a great idea, but what concerns me is that for it to be any good, you are going to need hundreds and hundreds of questions and answers, so as they don't repeat over and over again...
McBain is offline
Send a message via ICQ to McBain
ajax
Veteran Member
Join Date: Jan 2005
Old 05-26-2005 , 18:58  
Reply With Quote #17

Quote:
Originally Posted by ichthys
Also.....(last thing i promise, bet ajax's response will be faster than mine lol)
any line that has es or es_ at the beginning will not need es_ for any of the other commands down the like. This will help with performance.
if you look at my code, i hardly ever use x... i'm just lazy that way
and it covers up my shortcomings in ES expansion understanding ;)
ajax is offline
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 19:06  
Reply With Quote #18

Cheers guys,

Firstly, to ichthys - I hadn't finished the script and the colour isn't a token colour, just a random one to differentiate as I was in a rush.

Cheers for the ideas on how to minimise it (you can tell i'm new)

I hadn't finished up that's why nothing was there to execute but cheers mate ;)

Also thanks about the variable, I didn't know how to clear it so I made it as long as possible i'll edit that now.

To ajax cheers for that snippet of code it will make it even better, i'm hoping to have this up and ready for testing before 12pm midnight my time (55 minutes) .


This community is so good;)

BTW anyone want to come test it on a server? I'm willing to host (UK) or play on someone elses?

Nat
volmasoft is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-26-2005 , 19:07  
Reply With Quote #19

Quote:
Originally Posted by ajax
Quote:
Originally Posted by Mattie
(By the way, I just want to chime in here to state that I think this is a really neat script idea.)
i agree. the reason why i started looking into betting scripts was to create things for dead players to do... a mini game of sorts. this is similar.

btw here's something i could use and maybe volmasoft could use it too... es_msg_deadonly
When im motivated I'll include this in my track_player scriptpack
__________________
ichthys is offline
volmasoft
Senior Member
Join Date: Apr 2005
Old 05-26-2005 , 19:08  
Reply With Quote #20

mcbain, i'm hoping to put together a massive colleciton of questions so if anyone wants to help please add a list to this post and i'll add them, i'll then release it as a script pack hopefully tommorow evening.

As in my last post i'm hoping to be testing before midnight so i'm going to sotp replying and clear up my coding ;) (and make my usual readme files)
volmasoft 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 00:37.


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