Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- | ==================================================== |
- | |
- | * Scipt Crate: 12/6/2023 |
- | * Script Create: Jovan Spasic |
- | |
- | * Script Type: Admin System |
- | * Credits: Y-Lees |
- | |
- | |
- | ==================================================== |
- * Creator Contact Facebook: https://www.facebook.com/profile.php?id=100074875885781
- */
- //============== [ INCLUDES ] ==============//
- #define CGEN_MEMORY 20000
- #include < a_samp >
- #include < sscanf\sscanf2 >
- #include < YSI_Storage\y_ini >
- #include < YSI_Coding\y_va >
- #include < YSI_Visual\y_commands >
- #include < YSI_Coding\y_timers >
- #include < YSI_Data\y_foreach >
- //============== [ COLORS ] ==============//
- #define color_white "{FFFFFF}"
- #define color_red "{FF6347}"
- //============== [ ITERATOR ] ==============//
- new Iterator:IterAdmin<MAX_PLAYERS>;
- #define ClearChatAll(%0,%1) for(new n=0; n<%1; n++) SendClientMessageToAll(-1, " ")
- //============== [ ENUM INFO ] ==============//
- enum pInfo
- {
- pAdmin
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //============== [ PUBLIC ] ==============//
- public OnPlayerSpawn(playerid)
- {
- /*Ovo po pravilu ne bi trebalo biti ovde posto ovo bi radilo uvek kada bi se igrac spawnovao
- Ako imate login/register onda dodajte ovo kada se igrac uloguje a ne ovde...*/
- if(PlayerInfo[playerid][pAdmin] > 0)
- {
- Iter_Add(IterAdmin, playerid);
- }
- return 1;
- }
- //============== [ STOCKS ] ==============//
- stock SendAdminMessage(const string:message[], va_args<>)
- {
- foreach(new i : IterAdmin)
- {
- SendClientMessage(i, va_return(message, va_start<1>));
- }
- return 1;
- }
- //============== [ TIMERS ] ==============//
- timer KickTimer[1000](playerid)
- {
- Kick(playerid);
- }
- //============== [ COMMANDS ] ==============//
- YCMD:makeadmin(playerid, const string:params[], help) = postaviadmina;
- YCMD:postaviadmina(playerid, const string:params[], help)
- {
- if(!IsPlayerAdmin( playerid ) ) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static id, level;
- if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "KORISCENJE: /postaviadmina [ID/Name] [Level]");
- if(level < 0 || level > 6) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Level ne moze ici ispod 0 ili vise od 6!");
- if(level == 0)
- {
- Iter_Remove(id, IterAdmin);
- PlayerInfo[id][pAdmin] = 0;
- return 1;
- }
- PlayerInfo[id][pAdmin] = level;
- Iter_Add(id, IterAdmin);
- SendClientMessage(playerid, -1, " "color_red"[#AdminCommand] "color_white"Uspesno ste dodelili Admina Level: %d | Igracu: %s", level, ReturnPlayerName(id));
- SendClientMessage(id, -1, " "color_red"[#Obavestenje] "color_white"Proglaseni ste za Admina Level: %d | od Strane: %s", level, ReturnPlayerName(playerid));
- return 1;
- }
- YCMD:a(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- if(sscanf(params, "s[70]", params)) return SendClientMessage(playerid,-1,"KORISCENJE: /a [text]");
- SendAdminMessage(""color_red"A | "color_white"%s: "color_red"%s", ReturnPlayerName(playerid), params);
- return 1;
- }
- YCMD:ao(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- if(sscanf(params,"s[50]", params)) return SendClientMessage(playerid,-1,"KORISCENJE: /ao [Text]");
- SendClientMessageToAll(-1," "color_red"(( Staff Team %s: "color_white"%s "color_red"))", ReturnPlayerName(playerid), params);
- return 1;
- }
- YCMD:dole(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]-3);
- return 1;
- }
- YCMD:xgoto(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static Float:Pos[3];
- if(sscanf(params, "fff",Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,-1,"KORISCENJE: /xgoto [X] [Y] [Z]");
- SetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
- SendClientMessage(playerid,-1," "color_red" [#AdminCommand] "color_white"Uspesno si se teleportovao na kordinate %f %f %f",Pos[0],Pos[1],Pos[2]);
- return 1;
- }
- YCMD:goto(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static Float:Pos[3], id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "KORISCENJE: /goto [ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID!");
- GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1]+2, Pos[2]);
- SendClientMessage(playerid, -1, " "color_red" [#AdminCommand] "color_white"Uspesno ste se teleportovali do igraca %s!", ReturnPlayerName(id));
- return 1;
- }
- YCMD:gethere(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static id, Float:Pos[3];
- if(sscanf(params, "d", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /gethere [ID]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
- if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Ne mozes teleportovati admina veceg od tebe!");
- if(playerid == id) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Ne mozes sam sebe teleportovati do sebe!");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(id, Pos[0]+2, Pos[1], Pos[2]);
- SetPlayerInterior(id, GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
- SendClientMessage(id, -1, " "color_red"Staff Team "color_white"%s vas je teleportovao do sebe!", ReturnPlayerName(playerid));
- return 1;
- }
- YCMD:cc(playerid, const string:params[], help)
- {
- ClearChatAll(-1, 120);
- SendClientMessageToAll(-1, " "color_red"* "color_white"Chat BOX je ociscenj od strane "color_red"Staff Teama");
- return 1;
- }
- YCMD:jpack(playerid, const string:params[], help) = jetpack;
- YCMD:jetpack(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK ? SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE) : SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK))
- SendClientMessage(playerid, -1, " "color_red" [#AdminCommand] "color_white" %s jetpack", if(GetPlayerSpecialAction == SPECIAL_ACTION_NONE ? "Uzeli ste" : "Unistili ste" ));
- return 1;
- }
- YCMD:kick(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static id;
- if(sscanf(params, "us[50]", id, params)) return SendClientMessage(playerid, -1, "KORISCENJE: /kick [ID/Name] [Razlog]");
- SendClientMessage(playerid, -1, " "color_red"[#AdminCommand] "color_white"Kikovali ste igraca %s | Razlog %s", ReturnPlayerName(id), params);
- SendClientMessage(id, -1, " "color_red"[#Obavestenje] "color_white"Izbaceni ste sa servera od strane: %s | Razlog: %s ", ReturnPlayerName(playerid), params);
- defer KickTimer[500](id);
- return 1;
- }
- YCMD:freeze(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /freeze [ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,""color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
- if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid,-1, " "color_red"GRESKA: "color_white"Ne mozes zalediti admina veceg od tebe");
- TogglePlayerControllable(id, false);
- SendClientMessage(playerid, -1," "color_red"[#AdminCommand] "color_white"Uspesno ste zaledili igraca: %s!", ReturnPlayerName(id));
- SendClientMessage(id, -1," "color_red"[#Obavestenje] "color_white"Staff Team: %s vas je zaledio!", ReturnPlayerName(playerid));
- return 1;
- }
- YCMD:unfreeze(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /unfreeze [ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,""color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
- if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid,-1, " "color_red"GRESKA: "color_white"Ne mozes odlediti admina veceg od tebe");
- TogglePlayerControllable(id, true);
- SendClientMessage(playerid, -1," "color_red"[#AdminCommand] "color_white"Uspesno ste odledili igraca: %s!", ReturnPlayerName(id));
- SendClientMessage(id, -1," "color_red"[#Obavestenje] "color_white"Staff Team: %s vas je odledio!", ReturnPlayerName(playerid));
- return 1;
- }
- YCMD:kill(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- static id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /kill [ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
- if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Ne mozes ubiti admina veceg od tebe");
- SendClientMessage(id, -1, " "color_red" (( "color_white"Staff Team: "color_red"%s "color_white"vas je ubio! "color_red"))", ReturnPlayerName(playerid));
- SetPlayerHealth(id, 0);
- return 1;
- }
- YCMD:allhealth(playerid, const string:params[], help) = svihealth;
- YCMD:svihealth(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- foreach(new i : Player) SetPlayerHealth(i, 100.0);
- SendClientMessageToAll(-1, " "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je napunio helte svim igracima "color_red"))", ReturnPlayerName(playerid));
- return 1;
- }
- YCMD:allarmour(playerid, const string:params[], help) = svipancir;
- YCMD:svipancir(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, " "color_red"GRESKA: "color_white"Nemate dozvolu za koriscenje ove komande");
- foreach(new i : Player) SetPlayerArmour(i, 100.0);
- SendClientMessageToAll(-1, " "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je napunio pancir svim igracima "color_red"))", ReturnPlayerName(playerid));
- return 1;
- }
- YCMD:pvreme(playerid, const string:params[], help) = podesivreme;
- YCMD:podesivreme(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,""CRVENA"GRESKA: "BELA"Niste Ovlasceni za upotrebu ove komande");
- static id;
- if(sscanf(params, "d", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /podesivreme [ID]");
- SendClientMessageToAll(-1," "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je promenio vreme u %d "color_red"))", ReturnPlayerName(playerid), id);
- SetWeather(id);
- return 1;
- }
- YCMD:psat(playerid, const string:params[], help) = podesisat;
- YCMD:podesisat(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,""CRVENA"GRESKA: "BELA"Niste Ovlasceni za upotrebu ove komande");
- static id;
- if(sscanf(params, "d", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /podesisat [ID]");
- SendClientMessageToAll(-1," "color_red"(( "color_white"Staff Team: "color_red"%s "color_white"je promenio sat u %d "color_red"))", ReturnPlayerName(playerid), id);
- SetWorldTime(id);
- return 1;
- }
- YCMD:specon(playerid, const string:params[], help)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,""CRVENA"GRESKA: "BELA"Niste Ovlasceni za upotrebu ove komande");
- static id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid,-1,"KORISCENJE: /specon [ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1," "color_red"GRESKA: "color_white"Upisali ste nepostojeci ID");
- TogglePlayerSpectating(playerid, true);
- if(IsPlayerInAnyVehicle(id)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
- else PlayerSpectatePlayer(playerid, id);
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- return 1;
- }
- YCMD:specoff(playerid, const string:params[], help)
- {
- SetPlayerHealth(playerid,99.0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerSpectating(playerid, false);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement