14.02.2013, 07:27
Reaction Contest - Question Test Creator w/ command
Introduction
First off all. I didn't copy this from Zher0. Yes i copy the idea but i script this my own.
I use YCMD and sscanf. This is different from other Reaction Contest and Question Test script.
Credits to ******, Zher0.
You type the command to start the Question or the Type Word.
To change the prize ($) and prize2 (score) change the define.
To change the end time of the question or typing change the define.
How to use the filterscript
open your server.cfg
on the filterscripts line
You will see
Example:
filterscripts LuxAdmin
plugins sscanf
Add reques in filterscripts line (in the right side of LuxAdmin)
Example:
filterscripts LuxAdmin reques
plugins sscanf
Add sscanf in plugins line
Example:
filterscripts LuxAdmin reques
plugins sscanf
Commands
/startquestion
Parameters: question | answer
Question - The question
Answer - will be the answer in the question
Usage (Explanation):
/startquestion
You need to put "," (without quotes) after the question.
Example:
/startquestion Who i am?, Romel
Who i am? - Is the question
, - Splitting it so that SA-MP will not think that Who i am? and Romel is in the same string
Romel - Is the answer.
_____________
/starttype
Parameters: word
Word - The word will be typed by player.
Example:
/starttype Justin Bieber is shit!
The first one who types it wins the PRIZE_PER_CONTEST and PRIZE_PER_CONTEST_SCO.
And kills the KillTest Timer.
How the system works?
Okay.
So here is the explanation.
The system command is run by y_commands by ******.
Which means fast.
Then in splitting strings. We use sscanf not that slow strtok.
When player starts a contest everytime.
A variable will set to 1 and a timer will run for QUESTION_TIMER (TYPING_TIMER). So that. Player cannot create contest at the same time. Or else will go to a glitch technical problems. When the KillTest callback has been called. The variable has been set back to 0. Then the timer will be killed.
When player wins. The variable is also set back to 0 and the timer is killed.
Easy isn't it?
DL
Reaction Contest - Question Test Creator (Full) - SolidFiles
Reaction Contest - Question Test Creator (Source) - Pastebin