Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include zcmd
- #include sscanf2
- #include colors
- #define GetName(%0) playerNAME[%0]
- #define SendFormatMessageToAll(%0,%1,%2) format(szString, sizeof(szString), %1, %2), SendClientMessageToAll(%0, szString)
- #define function%0(%1) forward%0(%1);public%0(%1)
- #define textON 0
- #define textReward 1
- #define textTimer 2
- new randomCharacter[52][] =
- {
- "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
- };
- new
- textOptions[3],
- textString[32],
- playerNAME[MAX_PLAYERS][MAX_PLAYER_NAME+1],
- szString[128];
- //==============================================================================
- public OnPlayerConnect(playerid)GetPlayerName(playerid, GetName(playerid), MAX_PLAYER_NAME+1);
- //==============================================================================
- public OnPlayerDisconnect(playerid, reason)GetName(playerid)[0] = EOS;
- //==============================================================================
- CMD:starttr(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))return 0;
- if(textOptions[textON])return SendClientMessage(playerid, Red, "[Error]: פעילות החזרה על הטקסט פועלת כבר");
- if(sscanf(params, "d", textOptions[textReward]))return SendClientMessage(playerid, White, "/StartTR [Reward*]");
- textOptions[textON] = 1;
- format(textString, sizeof(textString), "%d%s%s%d%s%s%d%s", random(10), randomCharacter[random(sizeof(randomCharacter))], randomCharacter[random(sizeof(randomCharacter))], random(10), randomCharacter[random(sizeof(randomCharacter))], randomCharacter[random(sizeof(randomCharacter))], random(10), randomCharacter[random(sizeof(randomCharacter))]);
- SendFormatMessageToAll(Yellow, "הפעיל את פעילות החזרה על הטקסט \"%s\" האדמין", GetName(playerid));
- SendFormatMessageToAll(Green, "\"%s\" - כאשר תרשמו את הטקסט הבא", textString);
- SendFormatMessageToAll(Cyan, "%d$ - אתם תקבלו", textOptions[textReward]);
- textOptions[textTimer] = SetTimer("textActTimer", 1000*60*2, false);
- return SendClientMessageToAll(Red, "שיהיה לכולם בהצלחה");
- }
- //==============================================================================
- CMD:stoptr(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))return 0;
- if(!textOptions[textON])return SendClientMessage(playerid, Red, "[Error]: אין פעילות חזרה על הטקסט פועלת כעת");
- KillTimer(textOptions[textTimer]);
- textOptions[textON] = 0;
- return SendFormatMessageToAll(Yellow, "ביטל את פעילות החזרה על הטקסט \"%s\" האדמין", GetName(playerid));
- }
- //==============================================================================
- public OnPlayerText(playerid, text[])
- {
- if(!strcmp(text, textString, false) && textOptions[textON])
- {
- KillTimer(textOptions[textTimer]);
- textOptions[textON] = 0;
- GivePlayerMoney(playerid, textOptions[textReward]);
- return SendFormatMessageToAll(Green, "זכה בפעילות החזרה על הטקסט וזכה ב%d$ \"%s\" השחקן", textOptions[textReward], GetName(playerid));
- }
- return 1;
- }
- //==============================================================================
- function textActTimer()
- {
- if(textOptions[textON])
- {
- textOptions[textON] = 0;
- SendClientMessageToAll(Green, ".אף אחד לא השתתף בפעילות החזרה על הטקסט, ובגלל זה היא בוטלה");
- }
- }
- //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement