Advertisement
Guest User

Admin_modul

a guest
May 16th, 2022
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.58 KB | None | 0 0
  1. //OVO JE MODUL "ADMIN SISTEM", POTREBNO JE DA SVE MODULE IMATE U GAMEMODES U SUPROTNOM BACAT CE VAM ERRORE
  2.  
  3. #include "a_samp"
  4. #include "YSI_Storage\y_ini"
  5. #include "YSI_Coding\y_hooks"
  6. #include "YSI_Visual\y_commands"
  7.  
  8. hook OnGameModeInit()   {
  9.     new h, m, s;
  10.     gettime( h, m, s );
  11.     printf("[ %02d:%02d:%02d ] YT_Admin skripta ucitana!", h, m, s);
  12.     return 1;
  13. }
  14.  
  15. YCMD:makeadmin(playerid, params[], help)    {
  16.     new targetid, adminlevel, string[128];
  17.     if( IsPlayerAdmin(playerid) )   {
  18.         if( sscanf(params, "id", targetid, adminlevel) ) return SendClientMessage(playerid, -1, ""color_red"( Uputa ) /"color_white"makeadmin "color_red"[ ID Igraca ] [ Admin Level ]");
  19.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac nije online.");
  20.         if( adminlevel < 1 || adminlevel > 1340 || adminlevel > 4 && adminlevel < 1338 ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Upisali ste nepravilan admin level. Admin level mora biti veci od 1 i manji od 5 ili veci od 1337 i manji od 1341.");
  21.         if( PlayerInfo[targetid][PLAYER_Admin] == adminlevel ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac je vec taj admin level.");
  22.  
  23.         PlayerInfo[targetid][PLAYER_Admin] = adminlevel;
  24.         SaveUser(targetid);
  25.  
  26.         format(string, sizeof(string), ""color_lorange"[YT] Cestitamo, rcon Vam je postavio admina "color_white"%d"color_lorange".", adminlevel);
  27.         SendClientMessage(targetid, -1, string);
  28.  
  29.         format(string, sizeof(string), ""color_lorange"[YT] Igracu "color_white"%s "color_lorange"ste postavili admina "color_white"%d"color_lorange".", PlayerNameFromID(targetid), adminlevel);
  30.         SendClientMessage(playerid, -1, string);
  31.     }
  32.     else return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  33.     return 1;
  34. }
  35.  
  36. YCMD:removeadmin(playerid, params[], help)  {
  37.     new targetid, string[128];
  38.     if( IsPlayerAdmin(playerid) )   {
  39.         if( sscanf(params, "id", targetid) ) return SendClientMessage(playerid, -1, ""color_red"( Uputa ) /"color_white"removeadmin "color_red"[ ID Igraca ]");
  40.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac nije online.");
  41.         if( PlayerInfo[targetid][PLAYER_Admin] < 1 ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac nije admin.");
  42.  
  43.         PlayerInfo[targetid][PLAYER_Admin] = 0;
  44.         SaveUser(targetid);
  45.  
  46.         SendClientMessage(targetid, -1, ""color_lorange"[YT] RCON Vam je izbrisao admina.");
  47.  
  48.         format(string, sizeof(string), ""color_lorange"[YT] Igracu "color_white"%s "color_lorange"ste izbrisali admina.", PlayerNameFromID(targetid));
  49.         SendClientMessage(playerid, -1, string);
  50.     }
  51.     else return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  52.     return 1;
  53. }
  54.  
  55. YCMD:kick(playerid, params[], help) {
  56.     new reason[64], targetid, string[128];
  57.     if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid) )    {
  58.         if( sscanf(params, "is[64]", targetid, reason) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa ) /"color_white"kick "color_red"[ ID Igraca ] [ Razlog ]");
  59.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
  60.         format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s "color_red"je kickovao "color_white"[%i] %s"color_red". Razlog: "color_white"%s", playerid, PlayerNameFromID(playerid), targetid, PlayerNameFromID(targetid), reason);
  61.         SendClientMessageToAll(0xC72639FF, string);
  62.         format(string, sizeof(string), "[YT] Igraca "color_white"[%i] %s "color_lorange"ste kickovali. Razlog: "color_white"%s", targetid, PlayerNameFromID(targetid), reason);
  63.         SendClientMessage(playerid, 0xE3C36BFF, string);
  64.         format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s "color_lorange"Vas je kickovao. Razlog: "color_white"%s", playerid, PlayerNameFromID(playerid), reason);
  65.         SendClientMessage(targetid, 0xE3C36BFF, string);
  66.         SetTimerEx("KickPlayer", 300, false, "i", targetid);
  67.     }
  68.     else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  69.     return 1;
  70. }
  71.  
  72. YCMD:goto(playerid, params[], help) {
  73.     new targetid, Float:X, Float:Y, Float:Z, string[128];
  74.     if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid)) {
  75.         if( sscanf(params, "i", targetid) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa )  /"color_white"goto "color_red"[ ID Igraca ]");
  76.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
  77.         if( targetid == playerid ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Ne mozete se teleportovati di sebe.");
  78.         GetPlayerPos(targetid, X, Y, Z);
  79.         SetPlayerPos(playerid, X+2, Y, Z);
  80.         format(string, sizeof(string), "[YT] Teleportovali ste se do igraca "color_white"[%i] %s"color_lorange".", targetid, PlayerNameFromID(targetid));
  81.         SendClientMessage(playerid, 0xE3C36BFF, string);
  82.         format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s"color_lorange" se teleportovao do Vas.", playerid, PlayerNameFromID(playerid));
  83.         SendClientMessage(targetid, 0xE3C36BFF, string);
  84.     }
  85.     else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  86.     return 1;
  87. }
  88.  
  89. YCMD:setskin(playerid, params[], help)  {
  90.     new targetid, skinid, string[128];
  91.     if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid)) {
  92.         if( sscanf(params, "ii", targetid, skinid) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa )  /"color_white"setskin "color_red"[ ID Igraca ] [ ID Skina ]");
  93.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
  94.         SetPlayerSkin(targetid, skinid);
  95.         PlayerInfo[targetid][PLAYER_Skin] = skinid;
  96.         SaveUser(targetid);
  97.         format(string, sizeof(string), "[YT] Igracu "color_white"[%i] %s "color_lorange"ste promijenili skin na "color_white"ID: %i"color_lorange".", targetid, PlayerNameFromID(targetid), skinid);
  98.         SendClientMessage(playerid, 0xE3C36BFF, string);
  99.         format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s "color_lorange"Vam je promijenio skin na "color_white"ID: %i"color_lorange".", targetid, PlayerNameFromID(playerid), skinid);
  100.         SendClientMessage(targetid, 0xE3C36BFF, string);
  101.     }
  102.     else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  103.     return 1;
  104. }
  105.  
  106. YCMD:givemoney(playerid, params[], help)    {
  107.     new targetid, money, string[128];
  108.     if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid)) {
  109.         if( sscanf(params, "id", targetid, money) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa )  /"color_white"givemoney "color_red"[ ID Igraca ] [ Novac ]");
  110.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
  111.         if( money < 1 ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Ne mozete dati manje od "color_green"$"color_white"1"color_gray".");
  112.         GivePlayerMoney(targetid, money);
  113.         PlayerInfo[targetid][PLAYER_Money] = PlayerInfo[targetid][PLAYER_Money]+money;
  114.         SaveUser(targetid);
  115.         format(string, sizeof(string), "[YT] Igracu "color_white"[%i] %s "color_lorange"ste dali "color_green"$"color_white"%d"color_lorange".", targetid, PlayerNameFromID(targetid), money);
  116.         SendClientMessage(playerid, 0xE3C36BFF, string);
  117.         format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s "color_lorange"Vam je dao "color_green"$"color_white"%d"color_lorange".", targetid, PlayerNameFromID(playerid), money);
  118.         SendClientMessage(targetid, 0xE3C36BFF, string);
  119.     }
  120.     else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  121.     return 1;
  122. }
  123.  
  124. YCMD:clearchat(playerid, params[], help)    {
  125.     new string[128];
  126.     if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid) )    {
  127.         for( new i = 0; i < 50; i++ )   {   SendClientMessage(playerid, -1, " ");   }
  128.         format(string, sizeof(string), "[YT] Admin "color_white"%s "color_lorange"je izbrisao chat.", PlayerNameFromID(playerid));
  129.         SendClientMessageToAll(0xE3C36BFF, string);
  130.         for( new x = 0; x < 4; x++ )    {   SendClientMessage(playerid, -1, " ");   }
  131.     }
  132.     else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
  133.     return 1;
  134. }
  135.  
  136. /*
  137.     Admin Leveli i njihove sifre
  138.         Admin Level 1   -   1
  139.         Admin Level 2   -   2
  140.         Admin Level 3   -   3
  141.         Admin Level 4   -   4
  142.         Glavni Admin    -   1338
  143.         Suvlasnik       -   1339
  144.         Vlasnik         -   1340
  145. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement