Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //OVO JE MODUL "ADMIN SISTEM", POTREBNO JE DA SVE MODULE IMATE U GAMEMODES U SUPROTNOM BACAT CE VAM ERRORE
- #include "a_samp"
- #include "YSI_Storage\y_ini"
- #include "YSI_Coding\y_hooks"
- #include "YSI_Visual\y_commands"
- hook OnGameModeInit() {
- new h, m, s;
- gettime( h, m, s );
- printf("[ %02d:%02d:%02d ] YT_Admin skripta ucitana!", h, m, s);
- return 1;
- }
- YCMD:makeadmin(playerid, params[], help) {
- new targetid, adminlevel, string[128];
- if( IsPlayerAdmin(playerid) ) {
- if( sscanf(params, "id", targetid, adminlevel) ) return SendClientMessage(playerid, -1, ""color_red"( Uputa ) /"color_white"makeadmin "color_red"[ ID Igraca ] [ Admin Level ]");
- if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac nije online.");
- 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.");
- if( PlayerInfo[targetid][PLAYER_Admin] == adminlevel ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac je vec taj admin level.");
- PlayerInfo[targetid][PLAYER_Admin] = adminlevel;
- SaveUser(targetid);
- format(string, sizeof(string), ""color_lorange"[YT] Cestitamo, rcon Vam je postavio admina "color_white"%d"color_lorange".", adminlevel);
- SendClientMessage(targetid, -1, string);
- format(string, sizeof(string), ""color_lorange"[YT] Igracu "color_white"%s "color_lorange"ste postavili admina "color_white"%d"color_lorange".", PlayerNameFromID(targetid), adminlevel);
- SendClientMessage(playerid, -1, string);
- }
- else return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- YCMD:removeadmin(playerid, params[], help) {
- new targetid, string[128];
- if( IsPlayerAdmin(playerid) ) {
- if( sscanf(params, "id", targetid) ) return SendClientMessage(playerid, -1, ""color_red"( Uputa ) /"color_white"removeadmin "color_red"[ ID Igraca ]");
- if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac nije online.");
- if( PlayerInfo[targetid][PLAYER_Admin] < 1 ) return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Igrac nije admin.");
- PlayerInfo[targetid][PLAYER_Admin] = 0;
- SaveUser(targetid);
- SendClientMessage(targetid, -1, ""color_lorange"[YT] RCON Vam je izbrisao admina.");
- format(string, sizeof(string), ""color_lorange"[YT] Igracu "color_white"%s "color_lorange"ste izbrisali admina.", PlayerNameFromID(targetid));
- SendClientMessage(playerid, -1, string);
- }
- else return SendClientMessage(playerid, -1, ""color_red"(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- YCMD:kick(playerid, params[], help) {
- new reason[64], targetid, string[128];
- if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid) ) {
- if( sscanf(params, "is[64]", targetid, reason) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa ) /"color_white"kick "color_red"[ ID Igraca ] [ Razlog ]");
- if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
- 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);
- SendClientMessageToAll(0xC72639FF, string);
- format(string, sizeof(string), "[YT] Igraca "color_white"[%i] %s "color_lorange"ste kickovali. Razlog: "color_white"%s", targetid, PlayerNameFromID(targetid), reason);
- SendClientMessage(playerid, 0xE3C36BFF, string);
- format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s "color_lorange"Vas je kickovao. Razlog: "color_white"%s", playerid, PlayerNameFromID(playerid), reason);
- SendClientMessage(targetid, 0xE3C36BFF, string);
- SetTimerEx("KickPlayer", 300, false, "i", targetid);
- }
- else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- YCMD:goto(playerid, params[], help) {
- new targetid, Float:X, Float:Y, Float:Z, string[128];
- if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid)) {
- if( sscanf(params, "i", targetid) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa ) /"color_white"goto "color_red"[ ID Igraca ]");
- if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
- if( targetid == playerid ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Ne mozete se teleportovati di sebe.");
- GetPlayerPos(targetid, X, Y, Z);
- SetPlayerPos(playerid, X+2, Y, Z);
- format(string, sizeof(string), "[YT] Teleportovali ste se do igraca "color_white"[%i] %s"color_lorange".", targetid, PlayerNameFromID(targetid));
- SendClientMessage(playerid, 0xE3C36BFF, string);
- format(string, sizeof(string), "[YT] Admin "color_white"[%i] %s"color_lorange" se teleportovao do Vas.", playerid, PlayerNameFromID(playerid));
- SendClientMessage(targetid, 0xE3C36BFF, string);
- }
- else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- YCMD:setskin(playerid, params[], help) {
- new targetid, skinid, string[128];
- if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid)) {
- if( sscanf(params, "ii", targetid, skinid) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa ) /"color_white"setskin "color_red"[ ID Igraca ] [ ID Skina ]");
- if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
- SetPlayerSkin(targetid, skinid);
- PlayerInfo[targetid][PLAYER_Skin] = skinid;
- SaveUser(targetid);
- 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);
- SendClientMessage(playerid, 0xE3C36BFF, string);
- 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);
- SendClientMessage(targetid, 0xE3C36BFF, string);
- }
- else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- YCMD:givemoney(playerid, params[], help) {
- new targetid, money, string[128];
- if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid)) {
- if( sscanf(params, "id", targetid, money) ) return SendClientMessage(playerid, 0xC72639FF, "( Uputa ) /"color_white"givemoney "color_red"[ ID Igraca ] [ Novac ]");
- if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Igrac nije online.");
- if( money < 1 ) return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Ne mozete dati manje od "color_green"$"color_white"1"color_gray".");
- GivePlayerMoney(targetid, money);
- PlayerInfo[targetid][PLAYER_Money] = PlayerInfo[targetid][PLAYER_Money]+money;
- SaveUser(targetid);
- 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);
- SendClientMessage(playerid, 0xE3C36BFF, string);
- 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);
- SendClientMessage(targetid, 0xE3C36BFF, string);
- }
- else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- YCMD:clearchat(playerid, params[], help) {
- new string[128];
- if( PlayerInfo[playerid][PLAYER_Admin] != 0 || IsPlayerAdmin(playerid) ) {
- for( new i = 0; i < 50; i++ ) { SendClientMessage(playerid, -1, " "); }
- format(string, sizeof(string), "[YT] Admin "color_white"%s "color_lorange"je izbrisao chat.", PlayerNameFromID(playerid));
- SendClientMessageToAll(0xE3C36BFF, string);
- for( new x = 0; x < 4; x++ ) { SendClientMessage(playerid, -1, " "); }
- }
- else return SendClientMessage(playerid, 0xC72639FF, "(YT) "color_gray"Niste ovlasteni da koristite ovu komandu.");
- return 1;
- }
- /*
- Admin Leveli i njihove sifre
- Admin Level 1 - 1
- Admin Level 2 - 2
- Admin Level 3 - 3
- Admin Level 4 - 4
- Glavni Admin - 1338
- Suvlasnik - 1339
- Vlasnik - 1340
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement