An /adminduty
#1

Hello guys, Im wondering if someone could make me an /adminduty.

Here is an admin command how its like in my script, So maybe you could edit it or so, Could you also make like an announcement that will be send like this: ''Administrator [Name] Has gone on duty''

Thanks.


dcmd_mute(playerid, params[])
{
if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "AdminLevel 1 needed for this command!");
else
{
new ID, reason[100];
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [id] [reason]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "Player is not connected");
else
{
new string[256], name[60], name2[60];
GetPlayerName(playerid, name, 60);
GetPlayerName(ID, name2, 60);
format(string, 256, "Administrator %s[%d] has muted %s[%d]. (Reason: %s)", name, playerid, name2, ID, reason);
SendClientMessageToAll(COLOR_YELLOW, string);
Muted[ID] = 1;
}
}
return 1;
}
Reply
#2

Код:
dcmd_adminduty(playerid, params[])
{
if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "AdminLevel 1 needed for this command!");
else
{
new string[256], name[60]
GetPlayerName(playerid, name, 60);
format(string, 256, "Administrator %s[%d] Has gone on Duty", name, playerid);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
return 1;
}
Something along those lines anyway. Post back error etc. That's untested btw.
Reply
#3

Quote:
Originally Posted by Mrkrabz
Посмотреть сообщение
Код:
dcmd_adminduty(playerid, params[])
{
if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "AdminLevel 1 needed for this command!");
else
{
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adminduty");
else
{
new string[256], name[60]
GetPlayerName(playerid, name, 60);
format(string, 256, "Administrator %s[%d] Has gone on Duty", name, playerid);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
return 1;
}
Something along those lines anyway. Post back error etc. That's untested btw.
...large strings?

Код:
dcmd_adminduty(playerid, params[])
{
if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "AdminLevel 1 needed for this command!");
else
{
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adminduty");
else
{
new string[61], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Administrator %s[%d] has gone on duty ", name, playerid);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
return 1;
}
Reply
#4

That's what i was thinking, But i left it neways.

Oh and also, get rid of this

Код:
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adminduty");
else
{
No need for it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)