Announcment after the admin command -
OldDirtyBastard - 08.07.2010
I wanna make that everytime someone gets kicked, banned or muted there will be an announcment at the screen
like
BANNED!
REASON: CHEATING
But only for the kicked/banned/muted guy..
Just for example lol, i woud make this threat look a bit better and
clearer but the forum doesnt alows me to :/ using curently the BAdmin FS...
Regards.
Re: Announcment after the admin command -
oliverrud - 08.07.2010
Use format(,,,)
Then SendClientMessageToAll(,)
Re: Announcment after the admin command -
Niixie - 08.07.2010
Hello. You need alot of sendclientmessages
i suggest you start by sending the player 30 messages like this
this is inside the kick command
pawn Код:
for(new i = 0; i < 30; i++)
{
SendClientMessage(playerid, 0xFFFF, " ");
}
SendClientMessage(playerid, 0xFF00AAFF, ".:- Kicked from SERVERNAME -:.");
SendClientMessage(playerid, 0xFF00AAFF, " ");
format(string, sizeof(string), " Admin: %s", ADMINNAMESTRING);
SendClientMessage(playerid, 0xFF00AAFF, string);
format(string, sizeof(string), " Reason: %s", REASONSTRING);
SendClientMessage(playerid, 0xFF00AAFF, string);
SendClientMessage(playerid, 0xFFFF, " ");
And thats the player message, if you need help with the rest of the kick command i suggest you learn zcmd and sscanf if you dont know it by now.
pawn Код:
CMD:kick(playerid, params[])
{
new id, reason[60], string[128], adminname[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, 0xFFFFFF, "USAGE: /kick <ID> <REASON>");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF00AAFF, "ERROR: Invalid playerid!");
else if(reason > 60) return SendClientMessage(playerid, 0xFF00AAFF, "ERROR: Reason is too long!");
else
{
for(new i = 0; i < 30; i++)
{
SendClientMessage(playerid, 0xFFFF, " ");
}
GetPlayerName(playerid, adminname, MAX_PLAYER_NAME);
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
SendClientMessage(playerid, 0xFF00AAFF, ".:- Kicked from SERVERNAME -:.");
SendClientMessage(playerid, 0xFF00AAFF, " ");
format(string, sizeof(string), " Admin: %s", adminname);
SendClientMessage(playerid, 0xFF00AAFF, string);
format(string, sizeof(string), " Reason: %s", reason);
SendClientMessage(playerid, 0xFF00AAFF, string);
SendClientMessage(playerid, 0xFFFF, " ");
Kick(id);
format(string, sizeof(string), "[ADMIN]: Administrator %s has kicked player %s [REASON: %s]", adminname, playername, reason);
SendClientMessageToAll(0xFF00AAFF, string);
}
return 1;
}
Untested, but should work. There you go
Re: Announcment after the admin command -
oliverrud - 08.07.2010
Why is there for(new i = 0; i < 30; i++)? i isn't being used anywhere?
Re: Announcment after the admin command -
introzen - 08.07.2010
pawn Код:
new string[128];
format(string,sizeof(string),"* %s has been kicked by Admin %s *", kickedplayerid, adminplayerid);
SendClientMessageToAll(0x0000FFAA,string);
Re: Announcment after the admin command -
OldDirtyBastard - 08.07.2010
hmm il try that thanks
Re: Announcment after the admin command -
Niixie - 08.07.2010
The loop is for sending 30 messages to the player without having 30 sendclientmessages in the script
Re: Announcment after the admin command -
OldDirtyBastard - 09.07.2010
alright i think i got it right now, i used the simples massage, same as when you get killed that massage comes up like "Wasted" i used it for the bann mute and kick, anyway thanks all