Advertisement
Guest User

Untitled

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