Guest User

Untitled

a guest
Sep 3rd, 2010
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.28 KB | None | 0 0
  1. /***************************************
  2.  ***   T - Money: Server side Money  ***
  3.  ***   <!> v1.0                      ***
  4.  ***   <!> Author: The Toni          ***
  5.  ***   <!> Last Update: 3/9/10       ***
  6.  ***   <!> Native Functions:         ***
  7.  ***   <!> T_GivePlayerMoney         ***
  8.  ***   <!> T_ResetPlayerMoney        ***
  9.  ***   <!> T_TakePlayerMoney         ***
  10.  ***************************************/
  11.  
  12. #include <a_samp>
  13.  
  14. new
  15.     Money[MAX_PLAYERS],
  16.     Timer
  17. ;
  18. //==============================================================================
  19. // -> T_OnGameModeInit() - Add this under OnGameModeInit()
  20. //==============================================================================
  21. stock T_OnGameModeInit()
  22. {
  23.     for(new a = 0; a < MAX_PLAYERS; ++a)
  24.     {
  25.         Timer = SetTimerEx("omgwtfh4x", 750, 1, "i", a);
  26.     }
  27. }
  28. //==============================================================================
  29. // -> T_OnGameModeExit() - Add this under OnGameModeExit()
  30. //==============================================================================
  31. stock T_OnGameModeExit()
  32. {
  33.     KillTimer(Timer);
  34. }
  35. //==============================================================================
  36. // -> T_OnFilterScriptInit() - Add this under OnFilterScriptInit()
  37. //==============================================================================
  38. stock T_OnFilterScriptInit()
  39. {
  40.     for(new j = 0; j < MAX_PLAYERS; ++a)
  41.     {
  42.         Timer = SetTimerEx("omgwtfh4x", 750, 1, "i", playerid);
  43.     }
  44. }
  45. //==============================================================================
  46. // -> T_OnFilterScriptExit() - Add this under OnFilterScriptExit()
  47. //==============================================================================
  48. stock T_OnFilterScriptExit()
  49. {
  50.     KillTimer(Timer);
  51.     return 1;
  52. }
  53. //==============================================================================
  54. // -> T_GivePlayerMoney - Use this function to give player money!
  55. //==============================================================================
  56. stock T_GivePlayerMoney(playerid, amount)
  57. {
  58.     Money[playerid] += amount;
  59.     GivePlayerMoney(playerid, amount);
  60. }
  61. //==============================================================================
  62. // -> T_ResetPlayerMoney - Use this function to reset a player's money!
  63. //==============================================================================
  64. stock T_ResetPlayerMoney(playerid)
  65. {
  66.     Money[playerid] = 0;
  67.     ResetPlayerMoney(playerid);
  68. }
  69. //==============================================================================
  70. // -> T_TakePlayerMoney - Use this function to take a player's money!
  71. //==============================================================================
  72. stock T_TakePlayerMoney(playerid, amount)
  73. {
  74.     Money[playerid] -= amount;
  75.     GivePlayerMoney(playerid, -amount);
  76. }
  77. //==============================================================================
  78. // -> Da ultimate public :3
  79. //==============================================================================
  80. forward omgwtfh4x(playerid);
  81. public omgwtfh4x(playerid)
  82. {
  83.     if(Money[playerid] < GetPlayerMoney(playerid))
  84.     {
  85.         new
  86.             str[128],
  87.             pName[24];
  88.         GetPlayerName(playerid, pName, 24);
  89.         format(str, sizeof(str), "SERVER: %s has been kicked for money hacking!", pName);
  90.         SendClientMessageToAll(0xFFFFFF, str);
  91.         Kick(playerid);
  92.     }
  93.     return 1;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment