Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // D-Admin -- Administration System
- // By DamonD(Damon Davidson)
- // V1.0
- #include <a_samp>
- #include zcmd
- #if defined FILTERSCRIPT
- #define pHelper
- #define pAdmin
- CMD:makeadmin(playerid, params[]) {
- if(PlayerInfo[playerid][pAdmin] >= 99998) {
- new
- iAdminValue,
- iTargetID;
- if(sscanf(params, "ui", iTargetID, iAdminValue)) {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
- }
- else if(IsPlayerConnected(iTargetID)) {
- if(PlayerInfo[iTargetID][pHelper] >= 1) {
- SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make Community Helpers admins!");
- }
- else {
- new
- szMessage[47 + (MAX_PLAYER_NAME * 2)];
- PlayerInfo[iTargetID][pAdmin] = iAdminValue;
- format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
- SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
- format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
- }
- }
- else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
- }
- else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
- return 1;
- }
- CMD:maketempadmin(playerid, params[])
- {
- new string[128], giveplayerid, minutes, rank;
- if(sscanf(params, "udd[64]", giveplayerid, rank, minutes)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /maketempadmin [playerid] [rank] [minutes]");
- if(PlayerInfo[playerid][pAdmin] >= 99998) {
- if(IsPlayerConnected(giveplayerid)) {
- if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) {
- SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
- return 1;
- }
- PlayerInfo[giveplayerid][pAdmin] = rank;
- IsTempAdmin[giveplayerid] = 1;
- /*new IsTempAdmin[MAX_PLAYERS];*/
- PlayerInfo[giveplayerid][pAdminTime] = minutes*60;
- /*format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s for %d minutes.", rank, GetPlayerNameEx(playerid), minutes);
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, szMessage);*/
- }
- else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
- }
- else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- new string[128], giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /freeze [playerid]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, "You can't freeze a higher admin.");
- return 1;
- }
- TogglePlayerControllable(giveplayerid, 0);
- SetPVarInt(giveplayerid, "IsFrozen", 1);
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- new string[128], giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /unfreeze [playerid]");
- if(IsPlayerConnected(giveplayerid))
- {
- DeletePVar(giveplayerid, "IsFrozen");
- TogglePlayerControllable(giveplayerid, 1);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "Invalid player specified.");
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- new string[128], giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /slap [playerid]");
- new Float:shealth;
- new Float:slx, Float:sly, Float:slz;
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerHealth(giveplayerid, shealth);
- SetPlayerHealth(giveplayerid, shealth-5);
- GetPlayerPos(giveplayerid, slx, sly, slz);
- SetPlayerPos(giveplayerid, slx, sly, slz+5);
- PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:playall(playerid, params[])
- {
- foreach(Player, i)
- {
- if (PlayerInfo[playerid][pAdmin] >= 9999)
- {
- if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /playall [Link]");
- PlayAudioStreamForPlayer(i, params);
- }
- }
- return 1;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement