Announcment after the admin command
#3

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
Reply


Messages In This Thread
Announcment after the admin command - by OldDirtyBastard - 08.07.2010, 11:18
Re: Announcment after the admin command - by oliverrud - 08.07.2010, 11:22
Re: Announcment after the admin command - by Niixie - 08.07.2010, 11:31
Re: Announcment after the admin command - by oliverrud - 08.07.2010, 11:35
Re: Announcment after the admin command - by introzen - 08.07.2010, 11:53
Re: Announcment after the admin command - by OldDirtyBastard - 08.07.2010, 13:57
Re: Announcment after the admin command - by Niixie - 08.07.2010, 14:00
Re: Announcment after the admin command - by OldDirtyBastard - 09.07.2010, 09:23

Forum Jump:


Users browsing this thread: 2 Guest(s)