Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _ ______ _ _ _____ _
- | | | ___ \ | | (_) / ___| | |
- | |__ | |_/ /___ __ _ ___| |_ _ ___ _ __ \ `--. _ _ ___| |_ ___ _ __ ___
- | '_ \ | // _ \/ _` |/ __| __| |/ _ \| '_ \ `--. \ | | / __| __/ _ \ '_ ` _ \
- | |_) | | |\ \ __/ (_| | (__| |_| | (_) | | | | /\__/ / |_| \__ \ || __/ | | | | |
- |_.__/ \_| \_\___|\__,_|\___|\__|_|\___/|_| |_| \____/ \__, |___/\__\___|_| |_| |_|
- ______ __/ |
- |______| |___/
- b_Reaction System
- Scripter : Bolex_
- All rights reserved © 2017 - 2018
- */
- #include <a_samp>
- #define COLOR_RED "{F81414}"
- #define COLOR_GREEN "{6EF83C}"
- #define COLOR_ORANGE "{FF7E19}"
- #define TIMEPASS (4)
- #define LEAST_NUMBER (672352)
- #define LARGEST_NUMBER (9756153)
- forward StartNewTest();
- forward CorrectAnswer( playerid );
- new NUMBER = -1;
- public OnFilterScriptInit()
- {
- SetTimer("StartNewTest",(1000*60*TIMEPASS),1);
- return 1;
- }
- public StartNewTest()
- {
- new string[ 128 ];
- NUMBER = random( LEAST_NUMBER - LARGEST_NUMBER );
- format(string,sizeof string,"[REACTION]: {FFFFFF}Who first type {F81414}%d {FFFFFF}he wins some cash.", NUMBER);
- 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);
- new randmoney = 3000 + random(10);
- GivePlayerMoney(playerid, randmoney);
- format(string,sizeof string,"[REACTION] {FFFFFF}%s has won the reaction test and won prize (%d{6EF83C}${FFFFFF})",pName, randmoney);
- SendClientMessageToAll(0x48977996,string);
- NUMBER = -1;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement