Advertisement
muHamad-asYraf-aKmal

Stats TextDraw System (SA-MP - 0.3.7)

Sep 19th, 2015
994
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.91 KB | None | 0 0
  1. //==============================================================================
  2. //   ,---.  ,--.                      ,--.
  3. //  /  O  \ |  |,-. ,--,--,--. ,--,--.|  |
  4. // |  .-.  ||     / |        |' ,-.  ||  |
  5. // |  | |  ||  \  \ |  |  |  |\ '-'  ||  |
  6. // `--' `--'`--'`--'`--`--`--' `--`--'`--'
  7. //==============================================================================
  8. // ,------. ,--.  ,--.  ,--.
  9. // |  .--. '`--',-'  '-.|  ,---.
  10. // |  '--'.',--.'-.  .-'|  .-.  |
  11. // |  |\  \ |  |  |  |  |  | |  |
  12. // `--' '--'`--'  `--'  `--' `--'
  13. //==============================================================================
  14. #include <a_samp>
  15.  
  16. public OnFilterScriptInit()
  17. {
  18.     print("\n ------------------------------------------------- ");
  19.     print(" - Stats TextDraw System by [A]kmal & [H]arith - ");
  20.     print(" ------------------------------------------------- \n");
  21.     return 1;
  22. }
  23. new PlayerText:remix[MAX_PLAYERS];
  24. new pKills[MAX_PLAYERS], pDeaths[MAX_PLAYERS];
  25.  
  26. public OnFilterScriptExit()
  27. {
  28.     return 1;
  29. }
  30.  
  31. public OnPlayerConnect(playerid)
  32. {
  33.     SendClientMessage(playerid, -1, "{00FFFF}Info: Stats TextDraw System by [A]kmal & [H]arith");
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerDisconnect(playerid, reason)
  38. {
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerSpawn(playerid)
  43. {
  44.     //=======================================================================
  45.     remix[playerid] = CreatePlayerTextDraw(playerid, 120.0, 415.0, "Score: - ~>~ Money: $- ~>~ Kill: - ~>~ Death: - ~>~ Skin: -");
  46.     PlayerTextDrawColor(playerid, remix[playerid], 0xFFFFFFFF);
  47.     PlayerTextDrawSetShadow(playerid, remix[playerid], 1);
  48.     PlayerTextDrawSetOutline(playerid, remix[playerid], 1);
  49.     PlayerTextDrawLetterSize(playerid, remix[playerid], 0.19, 0.89);
  50.     PlayerTextDrawBackgroundColor(playerid, remix[playerid], 0x000000FF);
  51.     PlayerTextDrawFont(playerid, remix[playerid], 2);
  52.     PlayerTextDrawAlignment(playerid, remix[playerid], 0);
  53.     PlayerTextDrawSetProportional(playerid, remix[playerid], 1);
  54.     PlayerTextDrawShow(playerid, remix[playerid]);
  55.     //=======================================================================
  56.     SetTimerEx("IsPlayerStats", 2000, true, "i", playerid);
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerDeath(playerid, killerid, reason)
  61. {
  62.     pDeaths[playerid]++;
  63.     pKills[killerid]++;
  64.     return 1;
  65. }
  66. forward IsPlayerStats(playerid);
  67. public IsPlayerStats(playerid)
  68. {
  69.     //=======================================================================
  70.     new string[MAX_PLAYERS];
  71.     PlayerTextDrawHide(playerid, remix[playerid]);
  72.     PlayerTextDrawShow(playerid, remix[playerid]);
  73.     format(string, sizeof(string), "Score: %d ~>~ Money: $%d ~>~ Kill: %d ~>~ Death: %d ~>~ Skin: %d", GetPlayerScore(playerid), GetPlayerMoney(playerid), pKills[playerid], pDeaths[playerid], GetPlayerSkin(playerid));
  74.     PlayerTextDrawSetString(playerid, remix[playerid], string);
  75.     //=======================================================================
  76.     return 1;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement