Advertisement
Guest User

[FS] Spielerverbindungsinfo v2.0

a guest
Feb 19th, 2011
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. *                                                                              *
  3. *                       [FS] Spielerverbingungsinfo v2.0                       *
  4. *                                                                              *
  5. *                          © 2011, Script by 4#Future                          *
  6. *                                                                              *
  7. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  8.  
  9. // ------------
  10. // - Includes -
  11. // ------------
  12.  
  13. #include <a_samp>
  14.  
  15.  
  16. // -----------
  17. // - Defines -
  18. // -----------
  19.  
  20. #define TIME_to_HIDE 8000       // Zeit bis die Info wieder ausgeblendet wird, in Millisekunden (Standard: 8s)
  21.  
  22. new Text:TdHeadline, Text:TdHGinfo, Text:TdSpielerName, Text:TdNachricht, Text:TdTrennung, Text:TdSpielerIP, Text:TdSpielerPing;
  23. new Text:DiscHeadline, Text:DiscHGinfo, Text:DiscSpielerName, Text:DiscNachricht;
  24.  
  25. forward ShowConInfo();
  26. forward HideConInfo();
  27. forward ShowDiscInfo();
  28. forward HideDiscInfo();
  29.  
  30.  
  31. // --------------
  32. // - Funktionen -
  33. // --------------
  34.  
  35. public OnFilterScriptInit()
  36. {
  37.     print(" ");
  38.     print("[FILTERSCRIPT] Spielerverbindungsinfo v2.0, by 4#Future");
  39.     print(" ");
  40.     return 1;
  41. }
  42.  
  43. public OnGameModeInit()
  44. {
  45.     // -- Textdraws --
  46.    
  47.     TdHeadline = TextDrawCreate(473.000000, 363.000000, "Verbindungsinfo...");
  48.     TextDrawBackgroundColor(TdHeadline, 255);
  49.     TextDrawFont(TdHeadline, 2);
  50.     TextDrawLetterSize(TdHeadline, 0.289999, 1.399999);
  51.     TextDrawColor(TdHeadline, -65281);
  52.     TextDrawSetOutline(TdHeadline, 0);
  53.     TextDrawSetProportional(TdHeadline, 1);
  54.     TextDrawSetShadow(TdHeadline, 1);
  55.     TextDrawUseBox(TdHeadline, 1);
  56.     TextDrawBoxColor(TdHeadline, 150);
  57.     TextDrawTextSize(TdHeadline, 639.000000, 0.000000);
  58.  
  59.     TdHGinfo = TextDrawCreate(473.000000, 379.000000, " ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~");
  60.     TextDrawBackgroundColor(TdHGinfo, 255);
  61.     TextDrawFont(TdHGinfo, 1);
  62.     TextDrawLetterSize(TdHGinfo, 0.500000, 1.000000);
  63.     TextDrawColor(TdHGinfo, -1);
  64.     TextDrawSetOutline(TdHGinfo, 0);
  65.     TextDrawSetProportional(TdHGinfo, 1);
  66.     TextDrawSetShadow(TdHGinfo, 1);
  67.     TextDrawUseBox(TdHGinfo, 1);
  68.     TextDrawBoxColor(TdHGinfo, 84215140);
  69.     TextDrawTextSize(TdHGinfo, 700.000000, 130.000000);
  70.  
  71.     TdSpielerName = TextDrawCreate(475.000000, 382.000000, "wird geladen...");
  72.     TextDrawBackgroundColor(TdSpielerName, 255);
  73.     TextDrawFont(TdSpielerName, 2);
  74.     TextDrawLetterSize(TdSpielerName, 0.270000, 1.200000);
  75.     TextDrawColor(TdSpielerName, -1);
  76.     TextDrawSetOutline(TdSpielerName, 0);
  77.     TextDrawSetProportional(TdSpielerName, 1);
  78.     TextDrawSetShadow(TdSpielerName, 1);
  79.  
  80.     TdNachricht = TextDrawCreate(475.000000, 396.000000, "wird geladen...");
  81.     TextDrawBackgroundColor(TdNachricht, 255);
  82.     TextDrawFont(TdNachricht, 2);
  83.     TextDrawLetterSize(TdNachricht, 0.270000, 1.200000);
  84.     TextDrawColor(TdNachricht, -1);
  85.     TextDrawSetOutline(TdNachricht, 0);
  86.     TextDrawSetProportional(TdNachricht, 1);
  87.     TextDrawSetShadow(TdNachricht, 1);
  88.  
  89.     TdTrennung = TextDrawCreate(473.000000, 414.000000, "-");
  90.     TextDrawBackgroundColor(TdTrennung, 255);
  91.     TextDrawFont(TdTrennung, 1);
  92.     TextDrawLetterSize(TdTrennung, 0.000000, -0.199997);
  93.     TextDrawColor(TdTrennung, -1);
  94.     TextDrawSetOutline(TdTrennung, 0);
  95.     TextDrawSetProportional(TdTrennung, 1);
  96.     TextDrawSetShadow(TdTrennung, 1);
  97.     TextDrawUseBox(TdTrennung, 1);
  98.     TextDrawBoxColor(TdTrennung, 336860385);
  99.     TextDrawTextSize(TdTrennung, 700.000000, 0.000000);
  100.  
  101.     TdSpielerIP = TextDrawCreate(475.000000, 418.000000, "wird geladen...");
  102.     TextDrawBackgroundColor(TdSpielerIP, 255);
  103.     TextDrawFont(TdSpielerIP, 2);
  104.     TextDrawLetterSize(TdSpielerIP, 0.270000, 1.200000);
  105.     TextDrawColor(TdSpielerIP, -1);
  106.     TextDrawSetOutline(TdSpielerIP, 0);
  107.     TextDrawSetProportional(TdSpielerIP, 1);
  108.     TextDrawSetShadow(TdSpielerIP, 1);
  109.  
  110.     TdSpielerPing = TextDrawCreate(475.000000, 431.000000, "wird geladen...");
  111.     TextDrawBackgroundColor(TdSpielerPing, 255);
  112.     TextDrawFont(TdSpielerPing, 2);
  113.     TextDrawLetterSize(TdSpielerPing, 0.270000, 1.200000);
  114.     TextDrawColor(TdSpielerPing, -1);
  115.     TextDrawSetOutline(TdSpielerPing, 0);
  116.     TextDrawSetProportional(TdSpielerPing, 1);
  117.     TextDrawSetShadow(TdSpielerPing, 1);
  118.    
  119.     //--------------------------------------------------------------------------
  120.    
  121.     DiscHeadline = TextDrawCreate(491.000000, 394.000000, "Verbindungsinfo...");
  122.     TextDrawBackgroundColor(TdHeadline, 255);
  123.     TextDrawFont(TdHeadline, 2);
  124.     TextDrawLetterSize(TdHeadline, 0.300000, 1.500000);
  125.     TextDrawColor(TdHeadline, -65281);
  126.     TextDrawSetOutline(TdHeadline, 0);
  127.     TextDrawSetProportional(TdHeadline, 1);
  128.     TextDrawSetShadow(TdHeadline, 1);
  129.     TextDrawUseBox(TdHeadline, 1);
  130.     TextDrawBoxColor(TdHeadline, 150);
  131.     TextDrawTextSize(TdHeadline, 639.000000, 0.000000);
  132.  
  133.     DiscHGinfo = TextDrawCreate(491.000000, 411.000000, " ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~");
  134.     TextDrawBackgroundColor(TdHGinfo, 255);
  135.     TextDrawFont(TdHGinfo, 1);
  136.     TextDrawLetterSize(TdHGinfo, 0.500000, 1.000000);
  137.     TextDrawColor(TdHGinfo, -1);
  138.     TextDrawSetOutline(TdHGinfo, 0);
  139.     TextDrawSetProportional(TdHGinfo, 1);
  140.     TextDrawSetShadow(TdHGinfo, 1);
  141.     TextDrawUseBox(TdHGinfo, 1);
  142.     TextDrawBoxColor(TdHGinfo, 84215140);
  143.     TextDrawTextSize(TdHGinfo, 662.000000, 1.000000);
  144.  
  145.     DiscSpielerName = TextDrawCreate(492.000000, 414.000000, "wird geladen...");
  146.     TextDrawBackgroundColor(TdSpielerName, 255);
  147.     TextDrawFont(TdSpielerName, 2);
  148.     TextDrawLetterSize(TdSpielerName, 0.240000, 1.300000);
  149.     TextDrawColor(TdSpielerName, -1);
  150.     TextDrawSetOutline(TdSpielerName, 0);
  151.     TextDrawSetProportional(TdSpielerName, 1);
  152.     TextDrawSetShadow(TdSpielerName, 1);
  153.  
  154.     DiscNachricht = TextDrawCreate(492.000000, 429.000000, "wird geladen...");
  155.     TextDrawBackgroundColor(TdNachricht, 255);
  156.     TextDrawFont(TdNachricht, 2);
  157.     TextDrawLetterSize(TdNachricht, 0.240000, 1.300000);
  158.     TextDrawColor(TdNachricht, -1);
  159.     TextDrawSetOutline(TdNachricht, 0);
  160.     TextDrawSetProportional(TdNachricht, 1);
  161.     TextDrawSetShadow(TdNachricht, 1);
  162.  
  163.     return 1;
  164. }
  165.  
  166. public OnPlayerConnect(playerid)
  167. {
  168.     new spname[MAX_PLAYER_NAME];
  169.     GetPlayerName(playerid, spname, sizeof(spname));
  170.  
  171.     new namestr[100];
  172.     format(namestr, sizeof(namestr), "Spieler ~r~~h~~h~%s~w~,", spname);
  173.     TextDrawSetString(TdSpielerName, namestr);
  174.  
  175.     new msgstr[255];
  176.     format(msgstr, sizeof(msgstr), "hat den Server betreten.");
  177.     TextDrawSetString(TdNachricht, msgstr);
  178.    
  179.     new ipadr[16];
  180.     GetPlayerIp(playerid, ipadr, sizeof(ipadr));
  181.    
  182.     new ipstr[50];
  183.     format(ipstr, sizeof(ipstr), "IP: ~r~~h~%s", ipadr);
  184.     TextDrawSetString(TdSpielerIP, ipstr);
  185.    
  186.     new pingstr[50];
  187.     format(pingstr, sizeof(pingstr), "Ping: ~r~~h~%d", GetPlayerPing(playerid));
  188.     TextDrawSetString(TdSpielerPing, pingstr);
  189.  
  190.     ShowConInfo();
  191.     SetTimer("HideConInfo", TIME_to_HIDE, false);
  192.  
  193.     return 1;
  194. }
  195.  
  196. public OnPlayerDisconnect(playerid, reason)
  197. {
  198.     new spname[MAX_PLAYER_NAME];
  199.     GetPlayerName(playerid, spname, sizeof(spname));
  200.    
  201.     new namestr[100];
  202.     format(namestr, sizeof(namestr), "Spieler ~r~~h~~h~%s~w~,", spname);
  203.     TextDrawSetString(TdSpielerName, namestr);
  204.  
  205.     new msgstr[255];
  206.     format(msgstr, sizeof(msgstr), "hat den Server verlassen.");
  207.     TextDrawSetString(TdNachricht, msgstr);
  208.  
  209.     ShowDiscInfo();
  210.     SetTimer("HideDiscInfo", TIME_to_HIDE, false);
  211.  
  212.     return 1;
  213. }
  214.  
  215. //------------------------------------------------------------------------------
  216.  
  217. public ShowConInfo()
  218. {
  219.     TextDrawShowForAll(TdHeadline);
  220.     TextDrawShowForAll(TdHGinfo);
  221.     TextDrawShowForAll(TdSpielerName);
  222.     TextDrawShowForAll(TdNachricht);
  223.     TextDrawShowForAll(TdTrennung);
  224.     TextDrawShowForAll(TdSpielerIP);
  225.     TextDrawShowForAll(TdSpielerPing);
  226. }
  227.  
  228. public HideConInfo()
  229. {
  230.     TextDrawHideForAll(TdHeadline);
  231.     TextDrawHideForAll(TdHGinfo);
  232.     TextDrawHideForAll(TdSpielerName);
  233.     TextDrawHideForAll(TdNachricht);
  234.     TextDrawHideForAll(TdTrennung);
  235.     TextDrawHideForAll(TdSpielerIP);
  236.     TextDrawHideForAll(TdSpielerPing);
  237. }
  238.  
  239. public ShowDiscInfo()
  240. {
  241.     TextDrawShowForAll(DiscHeadline);
  242.     TextDrawShowForAll(DiscHGinfo);
  243.     TextDrawShowForAll(DiscSpielerName);
  244.     TextDrawShowForAll(DiscNachricht);
  245. }
  246.  
  247. public HideDiscInfo()
  248. {
  249.     TextDrawHideForAll(DiscHeadline);
  250.     TextDrawHideForAll(DiscHGinfo);
  251.     TextDrawHideForAll(DiscSpielerName);
  252.     TextDrawHideForAll(DiscNachricht);
  253. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement