Advertisement
Guest User

TextDraw

a guest
May 20th, 2010
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. //_______________________________TextDraw FilterScripta by Slick!__________________________
  2.  
  3.  
  4. #include <a_samp>
  5.  
  6. #if defined FILTERSCRIPT
  7.  
  8. #define COLOR_GRAD1 0xB4B5B7FF
  9. #define COLOR_GRAD2 0xBFC0C2FF
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. //News textdraw
  14. new Text:NovostText;
  15. NovostText = TextDrawCreate(0.999990,432.999990, "Novosti:");
  16. TextDrawAlignment(NovostText,0);
  17. TextDrawBackgroundColor(NovostText,0x000000ff);
  18. TextDrawFont(NovostText,1);
  19. TextDrawLetterSize(NovostText,0.499999,1.100000);
  20. TextDrawColor(NovostText,COLOR_YELLOW2);
  21. TextDrawSetOutline(NovostText,1);
  22. TextDrawSetProportional(NovostText,1);
  23. return 1;
  24. }
  25. #endif
  26. public OnFilterScriptExit()
  27. {
  28. return 1;
  29. }
  30.  
  31.  
  32. public OnPlayerCommandText(playerid, cmdtext[])
  33. {
  34. new cmd[256];
  35. new sendername[MAX_PLAYER_NAME];
  36. new idx;
  37. new string[256];
  38. new Text:NovostText;
  39. #define COLOR_GRAD2 0xBFC0C2FF
  40. if(strcmp(cmd, "/Novost", true) == 0)
  41. {
  42. if(IsPlayerConnected(playerid))
  43. {
  44. {
  45. GetPlayerName(playerid, sendername, sizeof(sendername));
  46. new length = strlen(cmdtext);
  47. while ((idx < length) && (cmdtext[idx] <= ' '))
  48. {
  49. idx++;
  50. }
  51. new offset = idx;
  52. new result[64];
  53. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  54. {
  55. result[idx - offset] = cmdtext[idx];
  56. idx++;
  57. }
  58. result[idx - offset] = EOS;
  59. if(!strlen(result))
  60. {
  61. SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /novost [text]");
  62. return 1;
  63. }
  64. format(string, sizeof(string), "Novosti: ~w~%s",result);
  65. for(new i = 0; i < MAX_PLAYERS; i++)
  66. {
  67. if(IsPlayerConnected(i))
  68. {
  69. TextDrawShowForAll(NovostText);
  70. TextDrawSetString(NovostText,string);
  71. }
  72. }
  73. return 1;
  74. }
  75. }
  76. return 1;
  77. }
  78. return 0;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement