Advertisement
Guest User

Untitled

a guest
Sep 12th, 2011
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.48 KB | None | 0 0
  1. // Ucim brata i usput objavljujem :)
  2. /*
  3.    Credits - ne brisi jebo ga ti :D
  4.    * boris *
  5.    * K4R!K3 *
  6.  
  7. */
  8. #include < a_samp >
  9. #include < zcmd >
  10. #include < sscanf2 >
  11.  
  12. #define Scm(%0,%1)   SendClientMessage(%0,-1,%1)
  13.  
  14. new count=0, counttimer, countinuse;
  15. new Text:count0, Text:count1, Text:count2;
  16.  
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. count0 = TextDrawCreate(461.000000, 44.000000, "~n~");
  21. TextDrawBackgroundColor(count0, 255);
  22. TextDrawFont(count0, 1);
  23. TextDrawLetterSize(count0, 0.500000, 2.899999);
  24. TextDrawColor(count0, -1);
  25. TextDrawSetOutline(count0, 0);
  26. TextDrawSetProportional(count0, 1);
  27. TextDrawSetShadow(count0, 1);
  28. TextDrawUseBox(count0, 1);
  29. TextDrawBoxColor(count0, -16711681);
  30. TextDrawTextSize(count0, 496.000000, 0.000000);
  31.  
  32. count1 = TextDrawCreate(463.000000, 45.000000, "~n~");
  33. TextDrawBackgroundColor(count1, 255);
  34. TextDrawFont(count1, 1);
  35. TextDrawLetterSize(count1, 0.500000, 2.700000);
  36. TextDrawColor(count1, -1);
  37. TextDrawSetOutline(count1, 0);
  38. TextDrawSetProportional(count1, 1);
  39. TextDrawSetShadow(count1, 1);
  40. TextDrawUseBox(count1, 1);
  41. TextDrawBoxColor(count1, 255);
  42. TextDrawTextSize(count1, 494.000000, 0.000000);
  43.  
  44. count2 = TextDrawCreate(467.000000, 49.000000, "10");
  45. TextDrawBackgroundColor(count2, 255);
  46. TextDrawFont(count2, 3);
  47. TextDrawLetterSize(count2, 0.629999, 1.500000);
  48. TextDrawColor(count2, -1);
  49. TextDrawSetOutline(count2, 0);
  50. TextDrawSetProportional(count2, 1);
  51. TextDrawSetShadow(count2, 1);
  52. return 1;
  53. }
  54.  
  55. public OnFilterScriptExit()
  56. {
  57.     KillTimer(counttimer);
  58.     return 1;
  59. }
  60.  
  61. CMD:count(playerid, params[])
  62. {
  63.   if(!IsPlayerAdmin(playerid)) return 1;
  64.   if(countinuse == 1) return Scm(playerid, "Odbrojavanje je vec ukljuceno!");
  65.   new cc, str[128];
  66.   if(sscanf(params,"i", cc)) return Scm(playerid,"INFO:: /count [sekundi]");
  67.   else if(cc > 60) return Scm(playerid, "ERROR:: max. 60 sekundi");
  68.   else
  69.   {
  70.     count = cc +1;
  71.     format(str,sizeof(str),"Odbrojavanje pokrenuto, %d sekundi.", cc);
  72.     SendClientMessageToAll(-1,str);
  73.     counttimer = SetTimer("CountDown", 1000, true);
  74.     TextDrawShowForAll(count0);
  75.     TextDrawShowForAll(count1);
  76.     TextDrawShowForAll(count2);
  77.     countinuse=1;
  78.   }
  79.   return 1;
  80. }
  81.  
  82. forward CountDown(); public CountDown()
  83. {
  84.   new string[128];
  85.   if(count < 1)
  86.   {
  87.     TextDrawHideForAll(count0);
  88.     TextDrawHideForAll(count1);
  89.     TextDrawHideForAll(count2);
  90.     countinuse=0;
  91.     return KillTimer(counttimer);
  92.   }
  93.   count--;
  94.   format(string, sizeof(string),"%d", count);
  95.   TextDrawSetString(count2, string);
  96.   return 1;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement