Guest User

Restorer

a guest
Nov 9th, 2011
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. /*
  2. Author: Restorer
  3. Name: News
  4. All rights reserved.
  5. */
  6. #include <a_samp>
  7. #include <ZCMD>
  8.  
  9. new Text:News;
  10.  
  11. main()
  12. {
  13. printf("News");
  14. }
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. News = TextDrawCreate(18.000000,428.000000,"~r~(News): ~w~ Aktualnie nikt nie pisze.");
  19. TextDrawAlignment(News, 0);
  20. TextDrawBackgroundColor(News, 0x000000FF);
  21. TextDrawFont(News, 2);
  22. TextDrawLetterSize(News, 0.199999, 0.899999);
  23. TextDrawSetOutline(News, 1);
  24. TextDrawSetProportional(News, 1);
  25. return 1;
  26. }
  27.  
  28. public OnPlayerSpawn(playerid)
  29. {
  30. TextDrawShowForPlayer(playerid, News);
  31. return 1;
  32. }
  33.  
  34. CMD:news(playerid, params[])
  35. {
  36. /* Można było to ładniej zrobić, ale tak mi się podoba :) */
  37. new news[168];
  38. if(!IsPlayerAdmin(playerid))
  39. {
  40. SendClientMessage(playerid, 0xCCFF00FF, "Błąd: Nie jesteś administratorem");
  41. return 1;
  42. }
  43.  
  44. if(isnull(params))
  45. {
  46. SendClientMessage(playerid, 0xCCFF00FF, "Błąd: /news [treść newsa]");
  47. return 1;
  48. }
  49.  
  50. format(news, 168, "~r~(News) %s pisze:~w~ %s", PlayerName(playerid), params);
  51. TextDrawSetString(News, news);
  52. return 1;
  53. }
  54.  
  55.  
  56. CMD:koniec(playerid, cmdtext[])
  57. {
  58. if(!IsPlayerAdmin(playerid))
  59. {
  60. SendClientMessage(playerid, 0xCCFF00FF, "Błąd: Nie jesteś administratorem");
  61. return 1;
  62. }
  63.  
  64. TextDrawSetString(News, "~r~(News): ~w~ Aktualnie nikt nie pisze.");
  65. return 1;
  66. }
  67.  
  68. public OnFilterScriptExit()
  69. {
  70. return 1;
  71. }
  72.  
  73. stock PlayerName(playerid)
  74. {
  75. new name[MAX_PLAYER_NAME];
  76. GetPlayerName(playerid, name, sizeof(name));
  77. return name;
  78. }
  79.  
Advertisement
Add Comment
Please, Sign In to add comment