Advertisement
Guest User

Simple Players Counter System By John_Magdy

a guest
Apr 4th, 2016
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.76 KB | None | 0 0
  1. #include a_samp
  2.  
  3. new Text:pcounter;
  4. #define MAX_P 100
  5.  
  6. public OnFilterScriptInit()
  7. {
  8. new string[32];
  9. format(string,sizeof(string),"%i/%i",OnlinePlayers(),MAX_P);
  10. pcounter = TextDrawCreate(309.000000, 9.000000, string);
  11. TextDrawAlignment(pcounter, 2);
  12. TextDrawBackgroundColor(pcounter, 255);
  13. TextDrawFont(pcounter, 1);
  14. TextDrawLetterSize(pcounter, 0.500000, 1.500000);
  15. TextDrawColor(pcounter, -1);
  16. TextDrawSetOutline(pcounter, 1);
  17. TextDrawSetProportional(pcounter, 1);
  18. return 1;
  19. }
  20.  
  21. public OnPlayerConnect(playerid)
  22. {
  23. TextDrawShowForPlayer(playerid, pcounter);
  24. return 1;
  25. }
  26.  
  27. OnlinePlayers()
  28. {
  29.     counter = 0;
  30.     for (new i = 0; i != MAX_PLAYERS; i++)
  31.     {
  32.         if (IsPlayerConnected(i))
  33.             ++counter;
  34.     }
  35.  
  36.     return counter;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement