#include <a_samp>#define TIMING 200 // hány másodpercenként adjon új feladatot#define wMAX 5000 // A megnyerhetõ összeg felsõ határa#define wMIN 1000 // A megnyerhetõ összeg alsó határa [NEM LEHET 0]#define rdiff 10 // A beírandó szöveg hosszúsága (MAX 64)#define INVALID_NAME \"°²`ÿ\"new rtimer,rtick,rname[MAX_PLAYER_NAME],rtask[64],rwin;public OnFilterScriptInit(){print(\"\\n..loading-----------------------------\");rname=INVALID_NAME%253Brtick = 0;rwin = 0;rtimer = SetTimer(\"StartReact\",1000*TIMING,true);print(\"- eReaction - Epsilon\'s Reaction Tester\");print(\"-------------------------------loaded.\\n\");return 1;}public OnFilterScriptExit(){print(\"\\n..loading-----------------------------\");print(\"- eReaction - Epsilon\'s Reaction Tester\"); KillTimer(rtimer);print(\"-----------------------------unloaded.\\n\");return 1;}forward StartReact();public StartReact(){if(rwin!=0) return 0;KillTimer(rtimer);new str[160];format(rtask,sizeof(rtask),\"1\",0);rwin = random(wMAX-wMIN)+wMIN;rname=INVALID_NAME%253Brtick = 0;for(new i = 0; i < rdiff; i++) if(i%2) rtask = 65+random(90-65); else rtask = 97+random(122-97);SendClientMessageToAll(0xADF200FF,\"Reakció teszt! {F7E600}Aki a {E9FF00}leggyorsabban {F7E600}beírja az alábbi {0098E5}feladatot {F7E600}megnyerheti a {F27100}nyereményt{F7E600}!\");format(str,160,\"{F27100}nyeremény{F7E600}: {FFFFFF}%d$ {FF0000}| {0098E5}feladat{F7E600}: {FFFFFF}%s\",rwin,rtask);SendClientMessageToAll(0xFFFFFFFF,str);rtick = GetTickCount();return 0;}public OnPlayerText(playerid, text[]){ if(rwin != 0){ if(!strcmp(text,rtask)) { if(!strcmp(rname,INVALID_NAME)) { new str[128]; format(str,128,\"{FFD700}%s\",rtask); SendPlayerMessageToAll(playerid,str); str = \"\\0\"; GetPlayerName(playerid,str,MAX_PLAYER_NAME); GivePlayerMoney(playerid,rwin); format(str,128,\"{0098E5}%s megnyerte a {F27100}%d dollárt{0098E5}! ({F27100}%.2f másodperc{0098E5})\",str,rwin,float((GetTickCount()-rtick)/1000)); SendClientMessageToAll(0xFFFFFFFF,str); rwin = 0; rtimer = SetTimer(\"StartReact\",1000*TIMING,false); return 0; } } }return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if (strcmp(\"/startrtest\", cmdtext, true) == 0) if(IsPlayerAdmin(playerid)){StartReact();return 1;}return 0;}
#include <a_samp>#define TIMING 200 // hány másodpercenként adjon új feladatot#define wMAX 5000 // A megnyerheto összeg felso határa#define wMIN 1000 // A megnyerheto összeg alsó határa [NEM LEHET 0]#define rdiff 10 // A beírandó szöveg hosszúsága (MAX 64)#define INVALID_NAME \"?°2`y\"new rtimer,rtimer2,rtick,rname[MAX_PLAYER_NAME],rtask[64],rwin;public OnFilterScriptInit(){print(\"\\n..loading-----------------------------\");rname=INVALID_NAME;rtick = 0;rwin = 0;rtimer = SetTimer(\"StartReact\",1000*TIMING,true);print(\"- eReaction - Epsilon\'s Reaction Tester\");print(\"-------------------------------loaded.\\n\");return 1;}public OnFilterScriptExit(){print(\"\\n..loading-----------------------------\");print(\"- eReaction - Epsilon\'s Reaction Tester\");KillTimer(rtimer);print(\"-----------------------------unloaded.\\n\");return 1;}forward StartReact();public StartReact(){if(rwin!=0) return 0;KillTimer(rtimer);KillTimer(rtimer2);new str[160];format(rtask,sizeof(rtask),\"1\",0);rwin = random(wMAX-wMIN)+wMIN;rname=INVALID_NAME;rtick = 0;for(new i = 0; i < rdiff; i++) if(i%2) rtask = 65+random(90-65); else rtask = 97+random(122-97);SendClientMessageToAll(0xADF200FF,\"Reakció teszt! {F7E600}Aki a {E9FF00}leggyorsabban {F7E600}beírja az alábbi {0098E5}feladatot {F7E600}megnyerheti a {F27100}nyereményt{F7E600}!\");format(str,160,\"{F27100}nyeremény{F7E600}: {FFFFFF}%d$ {FF0000}| {0098E5}feladat{F7E600}: {FFFFFF}%s\",rwin,rtask);SendClientMessageToAll(0xFFFFFFFF,str);rtick = GetTickCount();rtimer2 = SetTimer(\"ReloadReact\", 5*60000, false);return 0;}forward ReloadReact();public ReloadReact() {rwin = 0;SendClientMessageToAll(-1, \"Senki se oldotta meg a reakciótesztet 5 percen belül, ezért újraindul.\");StartReact();return 1;}public OnPlayerText(playerid, text[]){if(rwin != 0){if(!strcmp(text,rtask)){ if(!strcmp(rname,INVALID_NAME)) { KillTimer(rtimer2); new str[128]; format(str,128,\"{FFD700}%s\",rtask); SendPlayerMessageToAll(playerid,str); str = \"\\0\"; GetPlayerName(playerid,str,MAX_PLAYER_NAME); GivePlayerMoney(playerid,rwin); format(str,128,\"{0098E5}%s megnyerte a {F27100}%d dollárt{0098E5}! ({F27100}%.2f másodperc{0098E5})\",str,rwin,float((GetTickCount()-rtick)/1000)); SendClientMessageToAll(0xFFFFFFFF,str); rwin = 0; rtimer = SetTimer(\"StartReact\",1000*TIMING,false); return 0; }}}return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if (strcmp(\"/startrtest\", cmdtext, true) == 0) if(IsPlayerAdmin(playerid)){StartReact();return 1;}return 0;}