Advertisement
Guest User

[FS] Spielerverbindungsinfo

a guest
Feb 19th, 2011
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. *                                                                              *
  3. *                          [FS] Spielerverbingungsinfo                         *
  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;
  23.  
  24. forward ShowConInfo();
  25. forward HideConInfo();
  26.  
  27.  
  28. // --------------
  29. // - Funktionen -
  30. // --------------
  31.  
  32. public OnFilterScriptInit()
  33. {
  34.     print(" ");
  35.     print("[FILTERSCRIPT] Spielerverbindungsinfo, by 4#Future");
  36.     print(" ");
  37.     return 1;
  38. }
  39.  
  40. public OnGameModeInit()
  41. {
  42.     // -- Textdraws --
  43.    
  44.     TdHeadline = TextDrawCreate(491.000000, 394.000000, "Verbindungsinfo...");
  45.     TextDrawBackgroundColor(TdHeadline, 255);
  46.     TextDrawFont(TdHeadline, 2);
  47.     TextDrawLetterSize(TdHeadline, 0.300000, 1.500000);
  48.     TextDrawColor(TdHeadline, -65281);
  49.     TextDrawSetOutline(TdHeadline, 0);
  50.     TextDrawSetProportional(TdHeadline, 1);
  51.     TextDrawSetShadow(TdHeadline, 1);
  52.     TextDrawUseBox(TdHeadline, 1);
  53.     TextDrawBoxColor(TdHeadline, 150);
  54.     TextDrawTextSize(TdHeadline, 639.000000, 0.000000);
  55.  
  56.     TdHGinfo = TextDrawCreate(491.000000, 411.000000, " ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~");
  57.     TextDrawBackgroundColor(TdHGinfo, 255);
  58.     TextDrawFont(TdHGinfo, 1);
  59.     TextDrawLetterSize(TdHGinfo, 0.500000, 1.000000);
  60.     TextDrawColor(TdHGinfo, -1);
  61.     TextDrawSetOutline(TdHGinfo, 0);
  62.     TextDrawSetProportional(TdHGinfo, 1);
  63.     TextDrawSetShadow(TdHGinfo, 1);
  64.     TextDrawUseBox(TdHGinfo, 1);
  65.     TextDrawBoxColor(TdHGinfo, 84215140);
  66.     TextDrawTextSize(TdHGinfo, 662.000000, 1.000000);
  67.  
  68.     TdSpielerName = TextDrawCreate(492.000000, 414.000000, "wird geladen...");
  69.     TextDrawBackgroundColor(TdSpielerName, 255);
  70.     TextDrawFont(TdSpielerName, 2);
  71.     TextDrawLetterSize(TdSpielerName, 0.240000, 1.300000);
  72.     TextDrawColor(TdSpielerName, -1);
  73.     TextDrawSetOutline(TdSpielerName, 0);
  74.     TextDrawSetProportional(TdSpielerName, 1);
  75.     TextDrawSetShadow(TdSpielerName, 1);
  76.  
  77.     TdNachricht = TextDrawCreate(492.000000, 429.000000, "wird geladen...");
  78.     TextDrawBackgroundColor(TdNachricht, 255);
  79.     TextDrawFont(TdNachricht, 2);
  80.     TextDrawLetterSize(TdNachricht, 0.240000, 1.300000);
  81.     TextDrawColor(TdNachricht, -1);
  82.     TextDrawSetOutline(TdNachricht, 0);
  83.     TextDrawSetProportional(TdNachricht, 1);
  84.     TextDrawSetShadow(TdNachricht, 1);
  85.  
  86.     return 1;
  87. }
  88.  
  89. public OnPlayerConnect(playerid)
  90. {
  91.     new spname[MAX_PLAYER_NAME];
  92.     GetPlayerName(playerid, spname, sizeof(spname));
  93.  
  94.     new namestr[100];
  95.     format(namestr, sizeof(namestr), "Spieler ~r~%s~w~,", spname);
  96.     TextDrawSetString(TdSpielerName, namestr);
  97.  
  98.     new msgstr[255];
  99.     format(msgstr, sizeof(msgstr), "hat den Server betreten.");
  100.     TextDrawSetString(TdNachricht, msgstr);
  101.  
  102.     ShowConInfo();
  103.     SetTimer("HideConInfo", TIME_to_HIDE, false);
  104.  
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerDisconnect(playerid, reason)
  109. {
  110.     new spname[MAX_PLAYER_NAME];
  111.     GetPlayerName(playerid, spname, sizeof(spname));
  112.    
  113.     new namestr[100];
  114.     format(namestr, sizeof(namestr), "Spieler ~r~%s~w~,", spname);
  115.     TextDrawSetString(TdSpielerName, namestr);
  116.  
  117.     new msgstr[255];
  118.     format(msgstr, sizeof(msgstr), "hat den Server verlassen.");
  119.     TextDrawSetString(TdNachricht, msgstr);
  120.  
  121.     ShowConInfo();
  122.     SetTimer("HideConInfo", TIME_to_HIDE, false);
  123.  
  124.     return 1;
  125. }
  126.  
  127. //------------------------------------------------------------------------------
  128.  
  129. public ShowConInfo()
  130. {
  131.     TextDrawShowForAll(TdHeadline);
  132.     TextDrawShowForAll(TdHGinfo);
  133.     TextDrawShowForAll(TdSpielerName);
  134.     TextDrawShowForAll(TdNachricht);
  135. }
  136.  
  137. public HideConInfo()
  138. {
  139.     TextDrawHideForAll(TdHeadline);
  140.     TextDrawHideForAll(TdHGinfo);
  141.     TextDrawHideForAll(TdSpielerName);
  142.     TextDrawHideForAll(TdNachricht);
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement