Advertisement
Guest User

Untitled

a guest
Oct 1st, 2010
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3.  
  4. enum pInfo
  5. {
  6. Matou,
  7. Morreu,
  8. Level,
  9. }
  10. new PlayerInfo[MAX_PLAYERS][pInfo];
  11. new Text:Higor;
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print("Sistema By : Higor");
  17. print("--------------------------------------\n");
  18.  
  19. SetTimer("tt",20000,1);
  20. SetTimer("Levell",1200000,1);
  21.  
  22. Higor = TextDrawCreate(500.000000, 110.000000, "__");
  23. TextDrawBackgroundColor(Higor, 255);
  24. TextDrawFont(Higor, 1);
  25. TextDrawLetterSize(Higor, 0.300000, 1.000000);
  26. TextDrawColor(Higor, -1);
  27. TextDrawSetOutline(Higor, 1);
  28. TextDrawSetProportional(Higor, 1);
  29. TextDrawUseBox(Higor, 0);
  30. TextDrawBoxColor(Higor, 255);
  31. TextDrawTextSize(Higor, 620.000000, 0.000000);
  32. return 1;
  33. }
  34.  
  35. public OnFilterScriptExit()
  36. {
  37. return 1;
  38. }
  39.  
  40.  
  41.  
  42. public OnPlayerConnect(playerid)
  43. {
  44. Checar(playerid);
  45. return 1;
  46. }
  47.  
  48. public OnPlayerDisconnect(playerid, reason)
  49. {
  50. Salvar(playerid);
  51. return 1;
  52. }
  53.  
  54. public OnPlayerSpawn(playerid)
  55. {
  56. TextDrawShowForPlayer(playerid, Text:Higor);
  57. return 1;
  58. }
  59.  
  60. public OnPlayerDeath(playerid, killerid, reason)
  61. {
  62. PlayerInfo[playerid][Morreu]++;
  63. GivePlayerMoney(killerid,2000);
  64. PlayerInfo[killerid][Matou]++;
  65. return 1;
  66. }
  67.  
  68. forward tt(playerid);
  69. public tt(playerid)
  70. {
  71. new str[128];
  72. format(str, 128, "~w~Info Char : ~n~~g~Matou: ~w~%d ~n~~w~~y~Morreu: ~w~%d~n~~w~~p~Level: ~w~%d",PlayerInfo[playerid][Matou],PlayerInfo[playerid][Morreu],PlayerInfo[playerid][Level]);
  73. return TextDrawSetString(Text:Higor, str);
  74. }
  75.  
  76. stock Salvar(playerid)
  77. {
  78. new file[128];
  79. new name[MAX_PLAYER_NAME];
  80. GetPlayerName(playerid, name, sizeof(name));
  81. format(file,sizeof(file),"%s.ini",name);
  82. if(fexist(file))
  83. {
  84. dini_IntSet(file,"Matou", PlayerInfo[playerid][Matou]);
  85. dini_IntSet(file,"Morreu", PlayerInfo[playerid][Morreu]);
  86. dini_IntSet(file,"Level", PlayerInfo[playerid][Level]);
  87. }
  88. }
  89.  
  90. stock Checar(playerid)
  91. {
  92. new file[128];
  93. new name[MAX_PLAYER_NAME];
  94. GetPlayerName(playerid, name, sizeof(name));
  95. format(file,sizeof(file),"Higor/%s.ini",name);
  96. if(!fexist(file))
  97. {
  98. dini_Create(file);
  99. dini_IntSet(file,"Matou", PlayerInfo[playerid][Matou]);
  100. dini_IntSet(file,"Morreu", PlayerInfo[playerid][Morreu]);
  101. dini_IntSet(file,"Level", PlayerInfo[playerid][Level]);
  102. }
  103. if(fexist(file))
  104. {
  105. PlayerInfo[playerid][Matou] = dini_Int(file,"Matou");
  106. PlayerInfo[playerid][Morreu] = dini_Int(file,"Matou");
  107. PlayerInfo[playerid][Level] = dini_Int(file,"Level");
  108. }
  109. }
  110.  
  111.  
  112. forward Levell(playerid);
  113. public Levell(playerid)
  114. {
  115. PlayerInfo[playerid][Level]++;
  116. GameTextForPlayer(playerid, "~w~Level Adicionado", 5000, 1);
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement