New Mission -
Frikandel - 16.05.2009
Hi i play on a server and i see a new mission
how make i it

thx
screenshots:
---
what say he:
Код:
**Question: Are you still alive? **: The fastest who types code will earn $price
And if the fast player typ it then say he this
Код:
$$$ PlayerName has won $price,- by typing 'code' the fastest! $$$
screenshot:
Re: New Mission -
miokie - 16.05.2009
Search there's defiantly one out there.
I've seen it before.
Re: New Mission -
Think - 16.05.2009
reaction test *
Re: New Mission -
Frikandel - 16.05.2009
Please need help
Re: New Mission -
Rks25 - 16.05.2009
search for reactiontest in showroom.
Re: New Mission -
member - 16.05.2009
yeh, so many people ask for this, here's one from the other day:
http://forum.sa-mp.com/index.php?top...8592#msg638592
and here's the filterscript made by tomozj
Next time, press
Search mate.
Re: New Mission -
Frikandel - 16.05.2009
but this is a command I want a test with no command like cashbox but in reaction test
Re: New Mission -
Weirdosport - 16.05.2009
I'm not saying this is first rate, but it does the job.. Edit the strings to suit your liking, add your own commands to the array at the top... It has a built in mechanism so you don't get the same command twice in a row.. The prize is currently 10k, change this too..
Ironically it's made up of the past 2 scripts I made stuck together..
pawn Код:
#include <a_samp>
new RandomCommands[][50] = { "/hi", "/lol" };
new Current, Next, Command = -1, string[128];
forward Reaction();
public OnFilterScriptInit()
{
SetTimer("Reaction", 60000, 1);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(Command != -1)
{
if (strcmp(RandomCommands[Command], cmdtext, true) == 0)
{
format(string, sizeof(string), "ID %d typed %s the fastest!", playerid, RandomCommands[Command]);
SendClientMessageToAll(0xFF00FFFF, string);
GivePlayerMoney(playerid, 10000);
Command = -1;
return 1;
}
}
return 0;
}
public Reaction()
{
RandomCM();
format(string, sizeof(string), "First to type %s wins a prize!", RandomCommands[Command]);
SendClientMessageToAll(0xFF00FFFF, string);
return 1;
}
stock RandomCM()
{
Next = random(sizeof(RandomCommands));
if(Next == Current) return RandomCM();
else
{
Command = Next;
Current = Next;
return 1;
}
}
EDIT: Wait, you want this for non commands?
This will do it for questions and answers:
pawn Код:
#include <a_samp>
#define PRIZE 10000
#define INTERVAL 60000 //time in ms
enum Questions {
Question [128],
Answer[50]
}
new RandomCommands[][Questions] = {
{ "Type cookies for free cookies", "cookies" },
{ "Type milk for free milk to go with the cookies", "milk" }
};
new Current, Next, Command = -1, string[128];
forward Reaction();
public OnFilterScriptInit()
{
SetTimer("Reaction", INTERVAL, 1);
return 1;
}
public OnPlayerText(playerid, text[])
{
if(Command != -1)
{
if (strcmp(RandomCommands[Command][Answer], text, true) == 0)
{
format(string, sizeof(string), "ID %d typed %s the fastest and won %d!", playerid, RandomCommands[Command][Answer], PRIZE);
SendClientMessageToAll(0xFF00FFFF, string);
GivePlayerMoney(playerid, PRIZE);
Command = -1;
}
}
}
public Reaction()
{
RandomCM();
SendClientMessageToAll(0xFF00FFFF, RandomCommands[Command][Question]);
return 1;
}
stock RandomCM()
{
Next = random(sizeof(RandomCommands));
if(Next == Current) return RandomCM();
else
{
Command = Next;
Current = Next;
return 1;
}
}
eg. Questions could be.. "How many in a dozen?" and Answer could be "6"
Alternatively you could just do "Type fifty" and have the answer as "fifty" w/e floats your boat..
Re: New Mission -
Andom - 16.05.2009
Hello, i am the owner of the server, here is the code:
pawn Код:
new MinQuestionMoney = 1000;
new MaxQuestionMoney = 5000;
forward SendQuestionForMoney();
new RandomQuestionMoney;
new QuestionStarted;
public OnPlayerText(playerid, text[])
{
if(QuestionStarted == 1 && strfind(text[0], Question, false) == 0)
{
new string[128];
format(string, sizeof(string), "$$$ %s has won $%d,- by typing '%s' the fastest! $$$", PlayerName[playerid], RandomQuestionMoney, Question);
SendClientMessageToAll(COLOR_GREEN, string);
GivePlayerMoney(playerid, RandomQuestionMoney);
QuestionStarted = 0;
return 0;
}
return 1;
}
public SendQuestionForMoney()
{
new string[128];
new qstring[32];
RandomQuestionMoney = MinQuestionMoney+random(MaxQuestionMoney-MinQuestionMoney);
format(qstring, sizeof(qstring), "%d%d%d%d%d%d%d%d", random(9), random(9), random(9), random(9), random(9), random(9), random(9), random(9));
strmid(Question, qstring, false, strlen(qstring), 32);
format(string, sizeof(string), "** Question: Are you still alive? **: The fastest who types %s will earn $%d,-!", qstring, RandomQuestionMoney);
SendClientMessageToAll(COLOR_YELLOW, string);
QuestionStarted = 1;
return 1;
}
This is only a reaction test for numers, a few months ago i tried to do it with numbers and letters like: 4F9G3O1B but that didn't work.
I could make it but i am to lazy :P
Re: New Mission -
Frikandel - 16.05.2009
Please it give warnings
please make it good