An /adminduty - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: An /adminduty (
/showthread.php?tid=168203)
An /adminduty -
Rickzor14 - 15.08.2010
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;
}
Re: An /adminduty -
Mrkrabz - 15.08.2010
Код:
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.
Re: An /adminduty -
Calgon - 15.08.2010
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;
}
Re: An /adminduty -
Mrkrabz - 15.08.2010
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.