SA-MP Forums Archive
Quiz made with dialogs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quiz made with dialogs (/showthread.php?tid=176988)



Quiz made with dialogs - Matej_ - 15.09.2010

I am creating a quiz for my roleplay server (It will be made in dialogs) and I am wondering how
can I detect if player has 6 or more questions correct from 10 questions !

^ Please help me, thanks for the help.

Note: I didn't made they quiz yet.

- Matej


Re: Quiz made with dialogs - DragonBlaster50 - 15.09.2010

Well, When He picked the answer, do something like
CorrectAnswer == 1; (I hope you know how to make things like this completely??)
Then Go further counting up, and at the end, check it.
if(CorrectAnswer == 6)

Etc etc.


Re: Quiz made with dialogs - Matej_ - 15.09.2010

Quote:
Originally Posted by DragonBlaster50
View Post
I hope you know how to make things like this completely??)
Yes I know how to make things like that !

Quote:

if(CorrectAnswer == 6)

I just don't know what to put at the end of the quiz to detect how many correct answers he gots.
I don't think that gonna work ^ !


Re: Quiz made with dialogs - Mike_Peterson - 15.09.2010

can also be something with strcmp
(( strcmp is not only command, can be everything, npc name, text or command etc.

edit: i also think if u wanna calculate how many good answers it may be something like this: correctanswers++ but i dont know that :/ wait till a professional scripter comes and keep bumping


Re: Quiz made with dialogs - Matej_ - 15.09.2010

Quote:
Originally Posted by Mike_Peterson
View Post
can also be something with strcmp
(( strcmp is not only command, can be everything, npc name, text or command etc.

edit: i also think if u wanna calculate how many good answers it may be something like this: correctanswers++ but i dont know that :/ wait till a professional scripter comes and keep bumping
How can I calculate how many correct answers player has ?


Re: Quiz made with dialogs - Mike_Peterson - 15.09.2010

i just said: but i dont know that :/
so i dont know :/


Re: Quiz made with dialogs - HB - 15.09.2010

Add this code to the beginning of your script:
Code:
new TutorialStep[MAX_PLAYERS];
Add this code after your check of the correct answer:
Code:
TutorialStep[playerid]++;
Use this code to detect the step:
Code:
if(TutorialStep[playerid]==number)
Replace "number" with an actual number, and make sure you use that number only once. Also add an "else" in front of the "if" when you'd like to add more than one step (the if - else if structure).

For any more help I suggest you to download a script containing an tutorial, there are plenty!


Re: Quiz made with dialogs - Mike_Peterson - 15.09.2010

yeah, neoz was right so was i abit with the ++ tihng XD
look do for example this

Code:
if(TutorialStep[playerid]== 1)
{
SendClientMessage(playerid,urcolor,"You had 1/10 questions correct");
}
else if(TutorialStep[playerid]== 2)
{
SendClientMessage(playerid,urcolor,"You had 2/10 questions correct");
}
else if(TutorialStep[playerid]== 3)
{
SendClientMessage(playerid,urcolor,"You had 3/10 questions correct");
}
et cetera... so on.. You see? that should do it


Re: Quiz made with dialogs - Matej_ - 15.09.2010

Quote:
Originally Posted by Mike_Peterson
View Post
yeah, neoz was right so was i abit with the ++ tihng XD
look do for example this

Code:
if(TutorialStep[playerid]== 1)
{
SendClientMessage(playerid,urcolor,"You had 1/10 questions correct");
}
else if(TutorialStep[playerid]== 2)
{
SendClientMessage(playerid,urcolor,"You had 2/10 questions correct");
}
else if(TutorialStep[playerid]== 3)
{
SendClientMessage(playerid,urcolor,"You had 3/10 questions correct");
}
et cetera... so on.. You see? that should do it
ok thanks for the help !


Re: Quiz made with dialogs - Mike_Peterson - 15.09.2010

i've pmed u something but uhh can i test ur quiz if its done