24.08.2014, 20:59
how can I make so each play can type once for answer if its wrong he cant answer twice too answer.. ideas please.
//new bool var
new bool:answered[MAX_PLAERS];
//in your command...
if(answered[playerid]) return SendClientMessage(playerid,-1,"already answered...");
answered[playerid]=true;
forward EndTrivia();
ReactionTest[0] = GetTickCount(); //Start Counting Down
timer2[3] = SetTimer("EndTrivia", 10000, false); //Timer for the Trivia, Timer sets to 1 mininute
public EndTrivia()
{
switch(typem)
{
case 0:
{
format(strg, sizeof(strg), "No one won the Trivia the answer is '%d'", answer);
SendClientMessageToAll(YOUR_COLOR, strg);
}
case 1:
{
format(strg, sizeof(strg), "No one won the Trivia the answer is '%d'", answer);
SendClientMessageToAll(YOUR_COLOR, strg);
}
case 2:
{
format(strg, sizeof(strg), "No one won the Trivia the answer is '%d'", answer);
SendClientMessageToAll(YOUR_COLOR, strg);
}
}
endm = 0;
KillTimer(timer2[3]);
return 1;
}
how can I make so only 1 minute from trivia or bye..?? because there has to be an thing so if he dosent answer so after he cant answer..
|
#include <a_samp>
new ev_init;//var holding the timestamp of when "start" cmd has been issued
main(){}
public OnFilterScriptInit()
{
print("dummy_2 has been loaded!");
return 1;
}
public OnRconCommand(cmd[])
{
if(!(strcmp(cmd,"start")))
{
ev_init = gettime();//take the current timestamp as start-time
printf("event started: %d\n",ev_init);
}
else if(!(strcmp(cmd,"word")))
{
if(((gettime()) - (ev_init)) > 60) print("time is up! can't use that");//if current timestamp - start-time > 60 (1min) then time's up
else print("works!");//if it's not, this will appear
}
return 1;
}