Sanyi52

C++

Jul 20th, 2011
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new cvar;
  4. new Text:jatekosok;
  5.  
  6. forward PlayerFrissito(playerid);
  7.  
  8. public OnFilterScriptInit()
  9. {
  10.     SetTimer("PlayerFrissito", 2000,true);
  11.  
  12.     jatekosok = TextDrawCreate(555.000000, 99.000000, "1/50");
  13.     TextDrawBackgroundColor(jatekosok, 255);
  14.     TextDrawFont(jatekosok, 3);
  15.     TextDrawLetterSize(jatekosok, 0.539999, 1.500000);
  16.     TextDrawColor(jatekosok, -1);
  17.     TextDrawSetOutline(jatekosok, 1);
  18.     TextDrawSetProportional(jatekosok, 1);
  19.  
  20.     for(new i; i < MAX_PLAYERS; i ++)
  21.     {
  22.         if(IsPlayerConnected(i))
  23.         {
  24.             TextDrawShowForPlayer(i, jatekosok);
  25.         }
  26.     }
  27.     return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     TextDrawHideForAll(jatekosok);
  33.     TextDrawDestroy(jatekosok);
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerConnect(playerid)
  38. {
  39.     cvar++;
  40.     TextDrawShowForPlayer(playerid, jatekosok);
  41.     return 1;
  42. }
  43.  
  44. public OnPlayerDisconnect(playerid, reason)
  45. {
  46.     cvar--;
  47.     TextDrawHideForPlayer(playerid, jatekosok);
  48.     return 1;
  49. }
  50.  
  51. public PlayerFrissito(playerid)
  52. {
  53.     new string[16];
  54.     format(string, sizeof string, "%i/50", cvar);
  55.     TextDrawSetString(jatekosok, string);
  56.     return 1;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment