Advertisement
Guest User

Untitled

a guest
Jun 12th, 2023
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.40 KB | None | 0 0
  1. /*
  2.  
  3.  
  4.  
  5. | ==================================================== |
  6. | |
  7. | * Scipt Crate: 12/6/2023 |
  8. | * Script Create: Jovan Spasic |
  9. | |
  10. | * Script Type: Admin System |
  11. | * Credits: Y-Lees |
  12. | |
  13. | |
  14. | ==================================================== |
  15.  
  16. * Creator Contact Facebook: https://www.facebook.com/profile.php?id=100074875885781
  17.  
  18.  
  19.  
  20. */
  21.  
  22.  
  23. //============== [ INCLUDES ] ==============//
  24.  
  25. #define CGEN_MEMORY 20000
  26.  
  27. #include < a_samp >
  28.  
  29. #include < sscanf\sscanf2 >
  30.  
  31. #include < YSI_Storage\y_ini >
  32. #include < YSI_Coding\y_va >
  33. #include < YSI_Visual\y_commands >
  34. #include < YSI_Coding\y_timers >
  35. #include < YSI_Data\y_foreach >
  36.  
  37.  
  38. //============== [ COLORS ] ==============//
  39.  
  40. #define color_white "{FFFFFF}"
  41. #define color_red "{FF6347}"
  42.  
  43.  
  44. //============== [ ITERATOR ] ==============//
  45.  
  46. new Iterator:IterAdmin<MAX_PLAYERS>;
  47.  
  48.  
  49. #define ClearChatAll(%0,%1) for(new n=0; n<%1; n++) SendClientMessageToAll(-1, " ")
  50.  
  51. //============== [ ENUM INFO ] ==============//
  52.  
  53. enum pInfo
  54. {
  55. pAdmin
  56. }
  57.  
  58. new PlayerInfo[MAX_PLAYERS][pInfo];
  59.  
  60. //============== [ PUBLIC ] ==============//
  61.  
  62. public OnPlayerSpawn(playerid)
  63. {
  64. /*Ovo po pravilu ne bi trebalo biti ovde posto ovo bi radilo uvek kada bi se igrac spawnovao
  65. Ako imate login/register onda dodajte ovo kada se igrac uloguje a ne ovde...*/
  66.  
  67. if(PlayerInfo[playerid][pAdmin] > 0)
  68. {
  69. Iter_Add(IterAdmin, playerid);
  70. }
  71. return 1;
  72. }
  73.  
  74. //============== [ STOCKS ] ==============//
  75.  
  76. stock SendAdminMessage(const string:message[], va_args<>)
  77. {
  78. foreach(new i : IterAdmin)
  79. {
  80. SendClientMessage(i, va_return(message, va_start<1>));
  81. }
  82. return 1;
  83. }
  84.  
  85.  
  86. //============== [ TIMERS ] ==============//
  87.  
  88. timer KickTimer[1000](playerid)
  89. {
  90. Kick(playerid);
  91. }
  92.  
  93.  
  94. //============== [ COMMANDS ] ==============//
  95.  
  96. YCMD:makeadmin(playerid, const string:params[], help) = postaviadmina;
  97. YCMD:postaviadmina(playerid, const string:params[], help)
  98. {
  99. if(!IsPlayerAdmin( playerid ) ) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  100.  
  101. static id, level;
  102. if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "KORISCENJE: /postaviadmina [ID/Name] [Level]");
  103.  
  104. if(level < 0 || level > 6) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Level ne moze ici ispod 0 ili vise od 6!");
  105.  
  106. if(level == 0)
  107. {
  108. Iter_Remove(id, IterAdmin);
  109. PlayerInfo[id][pAdmin] = 0;
  110. return 1;
  111. }
  112.  
  113. PlayerInfo[id][pAdmin] = level;
  114. Iter_Add(id, IterAdmin);
  115.  
  116. SendClientMessage(playerid, -1, " "color_red"[#AdminCommand] "color_white"Uspesno ste dodelili Admina Level: %d | Igracu: %s", level, ReturnPlayerName(id));
  117. SendClientMessage(id, -1, " "color_red"[#Obavestenje] "color_white"Proglaseni ste za Admina Level: %d | od Strane: %s", level, ReturnPlayerName(playerid));
  118. return 1;
  119. }
  120.  
  121. YCMD:a(playerid, const string:params[], help)
  122. {
  123. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  124.  
  125. if(sscanf(params, "s[70]", params)) return SendClientMessage(playerid,-1,"KORISCENJE: /a [text]");
  126. SendAdminMessage(""color_red"A | "color_white"%s: "color_red"%s", ReturnPlayerName(playerid), params);
  127. return 1;
  128. }
  129.  
  130. YCMD:ao(playerid, const string:params[], help)
  131. {
  132. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  133.  
  134. if(sscanf(params,"s[50]", params)) return SendClientMessage(playerid,-1,"KORISCENJE: /ao [Text]");
  135. SendClientMessageToAll(-1," "color_red"(( Staff Team %s: "color_white"%s "color_red"))", ReturnPlayerName(playerid), params);
  136. return 1;
  137. }
  138.  
  139. YCMD:dole(playerid, const string:params[], help)
  140. {
  141. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  142.  
  143. static Float:Pos[3];
  144. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  145. SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]-3);
  146. return 1;
  147. }
  148.  
  149. YCMD:xgoto(playerid, const string:params[], help)
  150. {
  151. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  152.  
  153. static Float:Pos[3];
  154. if(sscanf(params, "fff",Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,-1,"KORISCENJE: /xgoto [X] [Y] [Z]");
  155.  
  156. SetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
  157. SendClientMessage(playerid,-1," "color_red" [#AdminCommand] "color_white"Uspesno si se teleportovao na kordinate %f %f %f",Pos[0],Pos[1],Pos[2]);
  158. return 1;
  159. }
  160.  
  161. YCMD:goto(playerid, const string:params[], help)
  162. {
  163. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  164.  
  165. static Float:Pos[3], id;
  166. if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "KORISCENJE: /goto [ID/Name]");
  167. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID!");
  168.  
  169. GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
  170. SetPlayerPos(playerid, Pos[0], Pos[1]+2, Pos[2]);
  171.  
  172. SendClientMessage(playerid, -1, " "color_red" [#AdminCommand] "color_white"Uspesno ste se teleportovali do igraca %s!", ReturnPlayerName(id));
  173. return 1;
  174. }
  175.  
  176. YCMD:gethere(playerid, const string:params[], help)
  177. {
  178. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  179.  
  180. static id, Float:Pos[3];
  181. if(sscanf(params, "d", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /gethere [ID]");
  182.  
  183. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
  184. if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Ne mozes teleportovati admina veceg od tebe!");
  185. if(playerid == id) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Ne mozes sam sebe teleportovati do sebe!");
  186.  
  187. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  188.  
  189. SetPlayerPos(id, Pos[0]+2, Pos[1], Pos[2]);
  190. SetPlayerInterior(id, GetPlayerInterior(playerid));
  191. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
  192.  
  193. SendClientMessage(id, -1, " "color_red"Staff Team "color_white"%s vas je teleportovao do sebe!", ReturnPlayerName(playerid));
  194. return 1;
  195. }
  196.  
  197. YCMD:cc(playerid, const string:params[], help)
  198. {
  199. ClearChatAll(-1, 120);
  200.  
  201. SendClientMessageToAll(-1, " "color_red"* "color_white"Chat BOX je ociscenj od strane "color_red"Staff Teama");
  202. return 1;
  203. }
  204.  
  205. YCMD:jpack(playerid, const string:params[], help) = jetpack;
  206. YCMD:jetpack(playerid, const string:params[], help)
  207. {
  208. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  209.  
  210. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK ? SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE) : SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK))
  211. SendClientMessage(playerid, -1, " "color_red" [#AdminCommand] "color_white" %s jetpack", if(GetPlayerSpecialAction == SPECIAL_ACTION_NONE ? "Uzeli ste" : "Unistili ste" ));
  212. return 1;
  213. }
  214.  
  215. YCMD:kick(playerid, const string:params[], help)
  216. {
  217. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  218.  
  219. static id;
  220. if(sscanf(params, "us[50]", id, params)) return SendClientMessage(playerid, -1, "KORISCENJE: /kick [ID/Name] [Razlog]");
  221.  
  222. SendClientMessage(playerid, -1, " "color_red"[#AdminCommand] "color_white"Kikovali ste igraca %s | Razlog %s", ReturnPlayerName(id), params);
  223. SendClientMessage(id, -1, " "color_red"[#Obavestenje] "color_white"Izbaceni ste sa servera od strane: %s | Razlog: %s ", ReturnPlayerName(playerid), params);
  224.  
  225. defer KickTimer[500](id);
  226. return 1;
  227. }
  228.  
  229. YCMD:freeze(playerid, const string:params[], help)
  230. {
  231. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  232.  
  233. static id;
  234. if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /freeze [ID/Name]");
  235. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,""color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
  236.  
  237. if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid,-1, " "color_red"GRESKA: "color_white"Ne mozes zalediti admina veceg od tebe");
  238.  
  239. TogglePlayerControllable(id, false);
  240.  
  241. SendClientMessage(playerid, -1," "color_red"[#AdminCommand] "color_white"Uspesno ste zaledili igraca: %s!", ReturnPlayerName(id));
  242. SendClientMessage(id, -1," "color_red"[#Obavestenje] "color_white"Staff Team: %s vas je zaledio!", ReturnPlayerName(playerid));
  243. return 1;
  244. }
  245.  
  246. YCMD:unfreeze(playerid, const string:params[], help)
  247. {
  248. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  249.  
  250. static id;
  251. if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /unfreeze [ID/Name]");
  252. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,""color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
  253.  
  254. if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid,-1, " "color_red"GRESKA: "color_white"Ne mozes odlediti admina veceg od tebe");
  255.  
  256. TogglePlayerControllable(id, true);
  257.  
  258. SendClientMessage(playerid, -1," "color_red"[#AdminCommand] "color_white"Uspesno ste odledili igraca: %s!", ReturnPlayerName(id));
  259. SendClientMessage(id, -1," "color_red"[#Obavestenje] "color_white"Staff Team: %s vas je odledio!", ReturnPlayerName(playerid));
  260. return 1;
  261. }
  262.  
  263. YCMD:kill(playerid, const string:params[], help)
  264. {
  265. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  266.  
  267. static id;
  268. if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /kill [ID/Name]");
  269.  
  270. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
  271. if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Ne mozes ubiti admina veceg od tebe");
  272.  
  273. SendClientMessage(id, -1, " "color_red" (( "color_white"Staff Team: "color_red"%s "color_white"vas je ubio! "color_red"))", ReturnPlayerName(playerid));
  274. SetPlayerHealth(id, 0);
  275. return 1;
  276. }
  277.  
  278. YCMD:allhealth(playerid, const string:params[], help) = svihealth;
  279. YCMD:svihealth(playerid, const string:params[], help)
  280. {
  281. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  282. foreach(new i : Player) SetPlayerHealth(i, 100.0);
  283.  
  284. SendClientMessageToAll(-1, " "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je napunio helte svim igracima "color_red"))", ReturnPlayerName(playerid));
  285. return 1;
  286. }
  287.  
  288. YCMD:allarmour(playerid, const string:params[], help) = svipancir;
  289. YCMD:svipancir(playerid, const string:params[], help)
  290. {
  291. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
  292. foreach(new i : Player) SetPlayerArmour(i, 100.0);
  293.  
  294. SendClientMessageToAll(-1, " "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je napunio pancir svim igracima "color_red"))", ReturnPlayerName(playerid));
  295. return 1;
  296. }
  297.  
  298. YCMD:pvreme(playerid, const string:params[], help) = podesivreme;
  299. YCMD:podesivreme(playerid, const string:params[], help)
  300. {
  301. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,""CRVENA"GRESKA: "BELA"Niste Ovlasceni za upotrebu ove komande");
  302.  
  303. static id;
  304. if(sscanf(params, "d", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /podesivreme [ID]");
  305.  
  306. SendClientMessageToAll(-1," "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je promenio vreme u %d "color_red"))", ReturnPlayerName(playerid), id);
  307. SetWeather(id);
  308. return 1;
  309. }
  310.  
  311. YCMD:psat(playerid, const string:params[], help) = podesisat;
  312. YCMD:podesisat(playerid, const string:params[], help)
  313. {
  314. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,""CRVENA"GRESKA: "BELA"Niste Ovlasceni za upotrebu ove komande");
  315.  
  316. static id;
  317. if(sscanf(params, "d", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /podesisat [ID]");
  318.  
  319. SendClientMessageToAll(-1," "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je promenio sat u %d "color_red"))", ReturnPlayerName(playerid), id);
  320. SetWorldTime(id);
  321. return 1;
  322. }
  323.  
  324. YCMD:specon(playerid, const string:params[], help)
  325. {
  326. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,""CRVENA"GRESKA: "BELA"Niste Ovlasceni za upotrebu ove komande");
  327.  
  328. static id;
  329. if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /specon [ID/Name]");
  330. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
  331.  
  332. TogglePlayerSpectating(playerid, true);
  333.  
  334. if(IsPlayerInAnyVehicle(id)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
  335. else PlayerSpectatePlayer(playerid, id);
  336.  
  337. SetPlayerInterior(playerid, GetPlayerInterior(id));
  338. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
  339. return 1;
  340. }
  341.  
  342. YCMD:specoff(playerid, const string:params[], help)
  343. {
  344. SetPlayerHealth(playerid,99.0);
  345.  
  346. SetCameraBehindPlayer(playerid);
  347. TogglePlayerSpectating(playerid, false);
  348. return 1;
  349. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement