Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- | SReaction System v1 |
- | Made by Scripter18 |
- */
- //---[INCLUDES]---//
- #include <a_samp>
- //---[INCLUDES]---//
- #define COLOR_RED "{F81414}"
- #define COLOR_GREEN "{6EF83C}"
- #define COLOR_ORANGE "{FF7E19}"
- #define TIMEPASS (4)
- #define LEAST_NUMBER (2000000)
- #define LARGEST_NUMBER (8000000)
- #define WINNERPRICE (1000)
- forward StartNewTest();
- forward CorrectAnswer(playerid);
- new NUMBER = -1;
- public OnFilterScriptInit()
- {
- SetTimer("StartNewTest",(1000*60*TIMEPASS),1);
- return 1;
- }
- public StartNewTest()
- {
- new string[128];
- NUMBER = LARGEST_NUMBER + random(LARGEST_NUMBER-LARGEST_NUMBER);
- format(string,sizeof string,"[REACTION]: {FFFFFF}Who first type {F81414}%d {FFFFFF}he wins $%d$ cash.",NUMBER,WINNERPRICE);
- SendClientMessageToAll(0x48977996,string);
- }
- public OnPlayerText(playerid,text[])
- {
- if(strval(text) == NUMBER && NUMBER != -1)
- {
- CorrectAnswer(playerid);
- }
- return 1;
- }
- public CorrectAnswer(playerid)
- {
- new pName[MAX_PLAYER_NAME],string[128];
- GetPlayerName(playerid,pName,sizeof pName);
- format(string,sizeof string,"[REACTION] {FFFFFF}%s has won the reaction test and won prize (%d{6EF83C}${FFFFFF}),",pName,WINNERPRICE);
- SendClientMessageToAll(0x48977996,string);
- GivePlayerMoney(playerid,WINNERPRICE);
- NUMBER = -1;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment