Advertisement
Guest User

Untitled

a guest
Jan 9th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. //***********************************Level System filterszkript by: Naufal****************************************
  2. //***********************************Fordította: Sheamus***********************************
  3. //*****************************You can edit it but keep the credit***********************************
  4. //***********************************Respect other people's work*************************************
  5.  
  6. #include <a_samp>
  7. #include <dini>
  8.  
  9. new pname[MAX_PLAYER_NAME];
  10. new hours[256], minutes[256];
  11. new naufalstringxd[512];
  12.  
  13. forward checklevel();
  14.  
  15. public OnFilterScriptInit()
  16. {
  17. print("\n----Attemping Load Level System by Naufal----");
  18. print("----Level System by Naufal learn from Pasha!---");
  19. print("------------------Loaded!!--------------------\n");
  20.  
  21. SetTimer("checklevel",60000,1);
  22. return 1;
  23. }
  24.  
  25. public checklevel()
  26. {
  27. for(new i; i<MAX_PLAYERS; i++)
  28. {
  29. if(IsPlayerConnected(i))
  30. {
  31. GetPlayerName(i,pname,sizeof(pname));
  32. format(hours, sizeof(hours), "%s-óra", pname);
  33. format(minutes, sizeof(minutes), "%s-perc", pname);
  34. if(!dini_Isset("PLEVELS.txt",hours) || !dini_Isset("PLEVELS.txt",minutes))
  35. {
  36. dini_IntSet("PLEVELS.txt",hours,0);
  37. dini_IntSet("PLEVELS.txt",minutes,1);
  38. }
  39. else
  40. {
  41. if(dini_Int("PLEVELS.txt",minutes)<59)
  42. {
  43. dini_IntSet("PLEVELS.txt",minutes,dini_Int("PLEVELS.txt",minutes)+1);
  44. }
  45.  
  46. if(dini_Int("PLEVELS.txt",minutes)>=59)
  47. {
  48. dini_IntSet("PLEVELS.txt",hours,dini_Int("PLEVELS.txt",hours)+1);
  49. dini_IntSet("PLEVELS.txt",minutes,0);
  50. format(naufalstringxd, sizeof(naufalstringxd), "Gratulálunk!! {ffffff}%s {00ff00}Szintet léptél, Szinted: {ffcc00}%d !", pname,dini_Int("PLEVELS.txt",hours));
  51. SendClientMessageToAll(0xFFCC00,naufalstringxd);
  52. }
  53.  
  54. }
  55. SetPlayerScore(i,dini_Int("PLEVELS.txt",hours));
  56. }
  57. }
  58. return 1;
  59. }
  60.  
  61. public OnPlayerConnect(playerid)
  62. {
  63. GetPlayerName(playerid,pname,sizeof(pname));
  64. format(hours, sizeof(hours), "%s-hours", pname);
  65. SetPlayerScore(playerid,dini_Int("PLEVELS.txt",hours));
  66. return 1;
  67. }
  68.  
  69.  
  70. public OnFilterScriptExit()
  71. {
  72. print("\n----Attemping Unload Level System by Naufal----");
  73. print("----Level System by Naufal learn from Pasha!---");
  74. print("----Fordította: Sheamus!---");
  75. print("-----------------Unloaded!!---------------------\n");
  76. return 1;
  77. }
  78.  
  79.  
  80. public OnPlayerCommandText(playerid, cmdtext[])
  81. {
  82. if (strcmp("/szintlepes", cmdtext, true, 10) == 0)
  83. {
  84. GetPlayerName(playerid,pname,sizeof(pname));
  85. format(hours, sizeof(hours), "%s-óra", pname);
  86. format(minutes, sizeof(minutes), "%s-perc", pname);
  87. format(naufalstringxd,sizeof(naufalstringxd),"{ffcc00}Jelenlegi szinted: {00ff00}%d\n{ffcc00}Idő, ameddig szintet lépsz: {00ff00}%d {ffcc00}perc.",dini_Int("PLEVELS.txt",hours),60-dini_Int("PLEVELS.txt",minutes));
  88. ShowPlayerDialog(playerid, 5678, DIALOG_STYLE_MSGBOX, "Jelenlegi szint statisztikád", naufalstringxd, "Okés","");
  89. return 1;
  90. }
  91. return 0;
  92. }
  93. //***********************************A Level System by Naufal****************************************
  94. //*********************************** Fordította: Sheamus *****************************************
  95. //*****************************You can edit it but keep the credit***********************************
  96. //***********************************Respect other people's work*************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement