Can i get /aduty cmd.
#1

Can anyone gimme /aduty cmd pawn code for admins to get on Duty and offduty.
Reply
#2

I need some information, For example, Do they need health, armour, weapons? and the variables and weapon ids.
Reply
#3

try this (i know and /aod and /aafk but if u need delete /aafk):

Код:
if(strcmp(cmd, "/aduty", true) == 0 || strcmp(cmd, "/aod", true) == 0)
	{
        if(PlayerInfo[playerid][pAdmin] >=1)
		{
	if(adminafk[playerid] == 1)
	{
	   SendClientMessage(playerid,COLOR_2RED, "Nu ai voie sa te pui ON Duty daca esti AFK.Scrie /aafk intai.");
	   return 0;
	}
			if(admind[playerid] == 0)
            {
			GetPlayerName(playerid, sendername, sizeof(sendername));
            new string2[256];
			admind[playerid] = 1;
			format(string2,sizeof(string2), "AdmWarning: %s Este Acuma La Datorie.Scrie /w sau /report Daca Ai Nevoie De Ajutor", sendername);
			ABroadCast(COLOR_YELLOW,string2,1);

					}

			else
			{
			GetPlayerName(playerid, sendername, sizeof(sendername));
            new string3[256];
            admind[playerid] = 0;
           	format(string3,sizeof(string3), "AdmWarning: %s Nu Mai Este La Datorie ca admin.", sendername);
			ABroadCast(COLOR_YELLOW,string3,1);

			}
		}
		return 1;
	}
	if(strcmp(cmd, "/aafk", true) == 0 || strcmp(cmd, "/adminafk", true) == 0)
	{
	if(admind[playerid] == 1)
	{
	   SendClientMessage(playerid,COLOR_2RED, "Nu ai voie sa te pui AFK daca esti ON Duty.Trebuie sa fii OFF Duty");
	   return 0;
	}
        if(PlayerInfo[playerid][pAdmin] >=1)
		{
			if(adminafk[playerid] == 0)
            {
			GetPlayerName(playerid, sendername, sizeof(sendername));
            new string4[256];
			adminafk[playerid] = 1;
			format(string4,sizeof(string4), "AdmWarning: %s Este Acum AFK. Nu are voie sa stea afk mai mult de 15 minute.", sendername);
			ABroadCast(COLOR_YELLOW,string4,1);

					}

			else
			{
			GetPlayerName(playerid, sendername, sizeof(sendername));
            new string5[256];
            adminafk[playerid] = 0;
           	format(string5,sizeof(string5), "AdmWarning: %s Nu Mai Este AFK.Acum este gata sa se puna ON Duty.", sendername);
			ABroadCast(COLOR_YELLOW,string,1);

			}
		}
		return 1;
	}
And sorry , text is in romanian
Reply
#4

//admin duty////////////////////////////////////////////
dcmd_adminduty(playerid, params[])
{
new selection[64], on[32], off[32];
on = "on";
off = "off";
if (sscanf(params, "s[64]", selection)) return SendClientMessage(playerid, red, "Usage: /adminduty [on/off]");

if(strcmp(selection, on, true) == 0)
{
if(pAdminLevel[playerid] < 1)
{
SendClientMessage(playerid, red, "You do not have permission to use this command");
return 1;
}
else if(pAdminLevel[playerid] >= 1 || IsPlayerAdmin(playerid))
{
SetPlayerColor(playerid, blue);
SetPlayerSkin(playerid, 217);
SendClientMessage(playerid, blue, "ADMIN COMMAND: /tele [ID] - Teleports you to a player - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /ptele [ID] - Teleports a player to you - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /restore [armour/health] - Restores a players armour or health - Level 2+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /givemoney [ID] [Amount] - Gives a player a certain amount of money - Level 3+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /kick [ID] [Reason] - Kicks a player for your specified reason - Level 2+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /ban [ID] [Reason] - Bans a player for your specified reason - Level 3+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /a [message] - Broadcasts a message to all - Level 3+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /akill [ID] - Kills the player of admins choice - Level 3+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /giveweapon [ID] - Be resposible with this, no Knifes, SPistols or miniguns, unless permission is granted - Level 2+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /freeze [ID] - Freezes the player - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /unfreeze [ID] - Unfreezes the player - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /setadmin [ID] [Level] - Makes player an admin - Level 4");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /setfaction[FacName] [ID] - Makes a player a member of specified faction - Level 4");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /myadminlevel - Tells you what your admin level and name is");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /specplayer - Spectates the player of choice, without being seen - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /specoff - Stops spectating a player - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /ac - Chat system for admins - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /lsdo - LSPD Door open, /lsdc - LSPD Door close - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /lsgo - LSPD Gate open, /lsgc - LSPD Gate close - Level 1+");
SendClientMessage(playerid, blue, "ADMIN COMMAND: /banhc - Ban a player from help chat if they are mis using it - Level 1+");
return 1;
}
}
if(strcmp(selection, off, true) == 0)
{
SetPlayerColor(playerid, white);
return 1;
}
else return 0;
}


Here you go if you want the commands for making someone an admin just ask
Reply
#5

Um not satisfactory i need the one that announces the your a onDuty admin no health weapons or anything just announnce
Reply
#6

try what I gave you...you may also like
Reply
#7

try this with the code I gave you but add this at the end,




for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (IsPlayerAdmin(i) || pAdminLevel[i] >= 1)
{
SendClientMessage(i, LIGHTBLUE , "*Name* has come on duty.);
}
}
}

return 0;
}

this will send a message to all admins
Reply
#8

Change the language to english pls
Reply
#9

Basically what the for loop does the first line, makes a variable for each player on the server, then it checks each player to see if they are an admin, if they are an admin then it will send a message to them saying "name" has come on duty as an admin.
Reply
#10

Dude this is the how i wanted
Код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{

SendClientMessage(playerid, COLOR_GREEN, "You are now on administrative duty! Remember to check /reports!");
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
new string[128];
format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are now off admin duty!");
new string[128];
format(string, sizeof(string), "Administrator %s is now off Admin Duty! (Do not /report for him/her!)", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 50);
PlayerInfo[playerid][pAdminDuty] = 0;
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)