Advertisement
WildWave

Untitled

May 8th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include a_samp
  2. #include zcmd
  3. #include sscanf2
  4. #include colors
  5.  
  6. #define GetName(%0) playerNAME[%0]
  7.  
  8. #define SendFormatMessageToAll(%0,%1,%2) format(szString, sizeof(szString), %1, %2), SendClientMessageToAll(%0, szString)
  9.  
  10. #define function%0(%1) forward%0(%1);public%0(%1)
  11.  
  12. #define textON 0
  13. #define textReward 1
  14. #define textTimer 2
  15.  
  16. new randomCharacter[52][] =
  17. {
  18. "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",
  19. "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"
  20. };
  21.  
  22. new
  23. textOptions[3],
  24. textString[32],
  25. playerNAME[MAX_PLAYERS][MAX_PLAYER_NAME+1],
  26. szString[128];
  27.  
  28. //==============================================================================
  29. public OnPlayerConnect(playerid)GetPlayerName(playerid, GetName(playerid), MAX_PLAYER_NAME+1);
  30. //==============================================================================
  31. public OnPlayerDisconnect(playerid, reason)GetName(playerid)[0] = EOS;
  32. //==============================================================================
  33. CMD:starttr(playerid, params[])
  34. {
  35. if(!IsPlayerAdmin(playerid))return 0;
  36. if(textOptions[textON])return SendClientMessage(playerid, Red, "[Error]: פעילות החזרה על הטקסט פועלת כבר");
  37. if(sscanf(params, "d", textOptions[textReward]))return SendClientMessage(playerid, White, "/StartTR [Reward*]");
  38. textOptions[textON] = 1;
  39. 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))]);
  40. SendFormatMessageToAll(Yellow, "הפעיל את פעילות החזרה על הטקסט \"%s\" האדמין", GetName(playerid));
  41. SendFormatMessageToAll(Green, "\"%s\" - כאשר תרשמו את הטקסט הבא", textString);
  42. SendFormatMessageToAll(Cyan, "%d$ - אתם תקבלו", textOptions[textReward]);
  43. textOptions[textTimer] = SetTimer("textActTimer", 1000*60*2, false);
  44. return SendClientMessageToAll(Red, "שיהיה לכולם בהצלחה");
  45. }
  46. //==============================================================================
  47. CMD:stoptr(playerid, params[])
  48. {
  49. if(!IsPlayerAdmin(playerid))return 0;
  50. if(!textOptions[textON])return SendClientMessage(playerid, Red, "[Error]: אין פעילות חזרה על הטקסט פועלת כעת");
  51. KillTimer(textOptions[textTimer]);
  52. textOptions[textON] = 0;
  53. return SendFormatMessageToAll(Yellow, "ביטל את פעילות החזרה על הטקסט \"%s\" האדמין", GetName(playerid));
  54. }
  55. //==============================================================================
  56. public OnPlayerText(playerid, text[])
  57. {
  58. if(!strcmp(text, textString, false) && textOptions[textON])
  59. {
  60. KillTimer(textOptions[textTimer]);
  61. textOptions[textON] = 0;
  62. GivePlayerMoney(playerid, textOptions[textReward]);
  63. return SendFormatMessageToAll(Green, "זכה בפעילות החזרה על הטקסט וזכה ב%d$ \"%s\" השחקן", textOptions[textReward], GetName(playerid));
  64. }
  65. return 1;
  66. }
  67. //==============================================================================
  68. function textActTimer()
  69. {
  70. if(textOptions[textON])
  71. {
  72. textOptions[textON] = 0;
  73. SendClientMessageToAll(Green, ".אף אחד לא השתתף בפעילות החזרה על הטקסט, ובגלל זה היא בוטלה");
  74. }
  75. }
  76. //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement