Guest User

Snow

a guest
Mar 3rd, 2009
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. /*******************************************InfoText*******************************************/
  2. /*******************************************by Snow********************************************/
  3. /*********************************************� 09*********************************************/
  4. /**************************When you replace the Copyright you will die!************************/
  5. #include <a_samp>
  6. #define SCRIPT_VERS "1.2"
  7. #define COLOR_RED 0xAA3333AA
  8. #define COLOR_GREEN 0x33AA33AA
  9.  
  10. forward InfoTextPublic(playerid);
  11.  
  12. new Text:InfoText[MAX_PLAYERS];
  13. new bool:InfoTextChange[MAX_PLAYERS];
  14.  
  15. public OnFilterScriptInit()
  16. {
  17. print("++++++++++++++++++++++++++++++++++++");
  18. print("############# InfoText #############");
  19. printf("############# Vers %s #############", SCRIPT_VERS);
  20. print("############# by Snow #############");
  21. print("++++++++++++++++++++++++++++++++++++");
  22. SetTimer("InfoTextPublic", 1000, 1);
  23. return 1;
  24. }
  25.  
  26. public OnPlayerConnect(playerid)
  27. {
  28. InfoTextChange[playerid] = true;
  29. return 1;
  30. }
  31.  
  32. public OnPlayerCommandText(playerid, cmdtext[])
  33. {
  34. if(strcmp("/info-off", cmdtext, true) == 0)
  35. {
  36. InfoTextChange[playerid] = false;
  37. SendClientMessage(playerid, COLOR_RED, "InfoText -OFF-");
  38. return 1;
  39. }
  40. if(strcmp("/info-on", cmdtext, true) == 0)
  41. {
  42. InfoTextChange[playerid] = true;
  43. SendClientMessage(playerid, COLOR_GREEN, "InfoText -ON-");
  44. return 1;
  45. }
  46. return 0;
  47. }
  48.  
  49. public InfoTextPublic(playerid)
  50. {
  51. new String[256];
  52. new Playaname[MAX_PLAYER_NAME], Serverhour, Serverminute, Serverday, Servermonth, Serveryear;
  53. GetPlayerName(playerid, Playaname, sizeof(Playaname));
  54. gettime(Serverhour, Serverminute);
  55. getdate(Serveryear, Servermonth, Serverday);
  56. new Playaping = GetPlayerPing(playerid);
  57. if(InfoTextChange[playerid] == true)
  58. {
  59. if(IsPlayerConnected(playerid))
  60. {
  61. TextDrawDestroy(InfoText[playerid]);
  62. }
  63. }
  64. if(InfoTextChange[playerid] == true)
  65. {
  66. if(IsPlayerConnected(playerid))
  67. {
  68. format(String, sizeof(String), "~b~Name: ~w~%s ~b~(~w~%i~b~) ~b~Ping: ~w~%dms ~b~Time: ~w~%d~b~:~w~%d ~b~Date: ~w~%d~b~-~w~%d~b~-~w~%d", Playaname, playerid, Playaping, Serverhour, Serverminute, Serverday, Servermonth, Serveryear);
  69. InfoText[playerid] = TextDrawCreate(55.000000,430.000000, String);
  70. TextDrawUseBox(InfoText[playerid],1);
  71. TextDrawBoxColor(InfoText[playerid],0x00000033);
  72. TextDrawTextSize(InfoText[playerid],650.000000,0.000000);
  73. TextDrawAlignment(InfoText[playerid],0);
  74. TextDrawBackgroundColor(InfoText[playerid],0x000000ff);
  75. TextDrawFont(InfoText[playerid],1);
  76. TextDrawLetterSize(InfoText[playerid],0.399999,1.100000);
  77. TextDrawColor(InfoText[playerid],0xffffffff);
  78. TextDrawSetOutline(InfoText[playerid],1);
  79. TextDrawSetProportional(InfoText[playerid],1);
  80. TextDrawSetShadow(InfoText[playerid],1);
  81. TextDrawShowForPlayer(playerid, InfoText[playerid]);
  82. }
  83. }
  84. return 1;
  85. }
  86. /*******************************************InfoText*******************************************/
  87. /*******************************************by Snow********************************************/
  88. /*********************************************� 09*********************************************/
  89. /**************************When you replace the Copyright you will die!************************/
Advertisement
Add Comment
Please, Sign In to add comment