Advertisement
Guest User

Untitled

a guest
May 11th, 2018
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. /*
  2. Filterscript Zlato By PinkPanter
  3.  
  4. NAPOMENA: Morate imati u scriptfiles "Korisnici" Folder !
  5.  
  6. */
  7. //==== [ INCLUDE ] ====//
  8.  
  9. #include <a_samp>
  10. #include <sscanf2>
  11. #include <zcmd>
  12. #include <YSI\y_ini>
  13.  
  14. //==== [ DEFINE ] ====//
  15.  
  16. #define PATH "/Korisnici/%s.ini"
  17. #define COL_SERVER "{FF8000}"
  18. #define SCM SendClientMessage
  19. #define BELA "{FFFFFF}"
  20. #define CRVENA 0xFF0000FF
  21.  
  22. //==== [ ENUM ] ====//
  23.  
  24. enum pInfo
  25. {
  26. pZlato,
  27. pNovac
  28. }
  29.  
  30. //==== [ NEW ] ====//
  31.  
  32. new PlayerInfo[MAX_PLAYERS][pInfo];
  33.  
  34. //==== [ STOCK ] ====//
  35.  
  36. stock UserPath(playerid)
  37. {
  38. new string[128],playername[MAX_PLAYER_NAME];
  39. GetPlayerName(playerid,playername,sizeof(playername));
  40. format(string,sizeof(string),PATH,playername);
  41. return string;
  42. }
  43.  
  44. //==== [ PUBLIC ] ====//
  45.  
  46. forward LoadUser_data(playerid,name[],value[]);
  47. public LoadUser_data(playerid,name[],value[])
  48. {
  49. INI_Int("Zlato",PlayerInfo[playerid][pZlato]);
  50. INI_Int("Novac",PlayerInfo[playerid][pNovac]);
  51. return 1;
  52. }
  53.  
  54. public OnPlayerConnect(playerid)
  55. {
  56. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  57. return 1;
  58. }
  59.  
  60. //==== [ CMD ] ====//
  61.  
  62. CMD:kupizlato(playerid, params[])
  63. {
  64. new INI:File = INI_Open(UserPath(playerid));
  65. INI_WriteInt(File, "Novac", GetPlayerMoney(playerid));
  66. INI_Close(File);
  67. new novacdinari = GetPlayerMoney(playerid);
  68. new zlatocena;
  69. zlatocena = PlayerInfo[playerid][pNovac] = 1300;
  70. if(novacdinari < zlatocena) return SCM(playerid, -1, ""COL_SERVER"[System By PinkPnater] "BELA"Nemate dovoljno novca !");
  71. else
  72. {
  73. SCM(playerid, -1, ""COL_SERVER"[System By PinkPnater] "BELA"Kupili ste 1g zlata !");
  74. GivePlayerMoney(playerid, -1300);
  75. PlayerInfo[playerid][pZlato] += 1;
  76. }
  77. return 1;
  78. }
  79. CMD:prodajzlato(playerid, params[])
  80. {
  81. if(PlayerInfo[playerid][pZlato] == 0) return SCM(playerid, -1, ""COL_SERVER"[System By PinkPnater] "BELA"Nemate zlato !");
  82. else
  83. {
  84. SCM(playerid, -1, ""COL_SERVER"[System By PinkPnater] "BELA"Prodali ste 1g zlata !");
  85. GivePlayerMoney(playerid, 1250);
  86. PlayerInfo[playerid][pZlato] -= 1;
  87. }
  88. return 1;
  89. }
  90. CMD:zlatarainfo(playerid, params[])
  91. {
  92. SCM(playerid, -1, ""COL_SERVER"[System By PinkPnater] "BELA"Zlatara info Kupovina zlata 1300 I Prodaja zlata 1250 !");
  93. return 1;
  94. }
  95. CMD:pjesma(playerid, params[], help)
  96. {
  97. PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/o3w0ooxnsg/Jala_Brat_x_Buba_Corelli_-_Klinka_Official_Lyric_Video_.mp3");
  98. return 1;
  99. }
  100. CMD:money(playerid, params[], help) {
  101.  
  102. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "Niste ovlasceni.");
  103. GivePlayerMoney(playerid,300000);
  104. return 1;
  105. }
  106. CMD:mute(playerid, params[], help) {
  107.  
  108. if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "Niste ovlasceni.");
  109. SendClientMessage(playerid,CRVENA,"Koristi /mute ID/NICK Minute RAZLOG!");
  110. return 1;
  111. }
  112. //======================= [ KRAJ FS ZLATO SYSTEM BY PinkPanter ] ==================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement