Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _________ _________ _
- | _ _ | /\ |____ ____| | |
- | | | | | | / \ | | | |____
- | | | | | | / /\ \ | | | ___ |
- | | | | | | / /__\ \ | | | | | |
- |_| |_| |_| /_/ \_\ |_| |_| |_|
- =============
- | Match |
- |Sys By |
- | XyZoN |
- |Skype: |
- | xplor.eden|
- ============
- */
- #include <a_samp>
- #define TIME 1 //מתי שתחרות תתחיל
- #define PRIZE 3000 //זכום הכסף שהשחקן יזכה
- #define PRIZESCORE 5 //ניקוד ששחקן יקבל שיזכה
- new answer;
- new endm = 0;
- new no1, no2, no3;
- new typem = -1;
- new timermath;
- new timermath2;
- new str[128];
- forward Math();
- forward MathEnd();
- #define COLOR_YELLOW 0xFFFF00FF
- #define white "{FFFFFF}"
- #define red "{FF002B}"
- #define orange "{F2C80C}"
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- typem = -1;
- endm = 0;
- timermath = SetTimer("Math", 1000*60*TIME, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- typem = -1;
- endm = 0;
- KillTimer(timermath);
- return 1;
- }
- #endif
- public Math()
- {
- typem = random(2);
- no1 = random(600);
- no2 = random(50);
- no3 = random(100);
- endm = 1;
- switch(typem)
- {
- case 0:
- {
- answer = no1 + no2 + no3;
- format(str, sizeof(str), "{00FCFF}$3,000 + 5 score: :זכום זכייה || {F3FF00}%d+%d+%d=?:שאלה", no1, no2, no3);
- SendClientMessageToAll(COLOR_YELLOW, str);
- }
- case 1:
- {
- answer = no1 - no2 - no3;
- format(str, sizeof(str), "{00FCFF}$3,000 + 5 score: :זכום זכייה || {F3FF00}%d-%d-%d=?:שאלה", no1, no2, no3);
- SendClientMessageToAll(COLOR_YELLOW, str);
- }
- case 2:
- {
- answer = no1 * no2 * no3;
- format(str, sizeof(str), "{00FCFF}$3,000 + 5 score: :זכום זכייה || {F3FF00}%d X %d X %d=?:שאלה", no1, no2, no3);
- SendClientMessageToAll(COLOR_YELLOW, str);
- }
- }
- SendClientMessageToAll(-1, "{00FCFF}!!!{F3FF00}יש לכם 30 שניות לענות על השאלה");
- timermath2 = SetTimer("MathEnd", 1000*30, false);
- return 1;
- }
- public MathEnd()
- {
- switch(typem)
- {
- case 0:
- {
- format(str, sizeof(str), "{00FCFF}%d:{00FCFF}אף אחד לא ענה נכון על השאלה,התשובה היא", answer);
- SendClientMessageToAll(COLOR_YELLOW, str);
- }
- case 1:
- {
- format(str, sizeof(str), "{00FCFF}%d:{00FCFF}אף אחד לא ענה נכון על השאלה,התשובה היא", answer);
- SendClientMessageToAll(COLOR_YELLOW, str);
- }
- case 2:
- {
- format(str, sizeof(str), "{00FCFF}%d:{00FCFF}אף אחד לא ענה נכון על השאלה,התשובה היא", answer);
- SendClientMessageToAll(COLOR_YELLOW, str);
- }
- }
- endm = 0;
- KillTimer(timermath2);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(strval(text) == answer && endm == 1)
- {
- format(str, sizeof(str), "{00FCFF}Winner:{00FCFF}%s(%d) {00FCFF}Money:{00FCFF}%d {00FCFF}Score:{00FCFF}%d {00FCFF}Answer:{00FCFF}%d", GetName(playerid), playerid, PRIZE, PRIZESCORE, answer);
- SendClientMessageToAll(COLOR_YELLOW, str);
- GivePlayerMoney(playerid, PRIZE);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + PRIZESCORE);
- KillTimer(timermath2);
- endm = 0;
- return 0;
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new pName[24];
- GetPlayerName(playerid, pName, 24);
- return pName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement