[FilterScript] AdminTalk - A simple admin chatroom
#1

AdminTalk by iToast

AdminTalk is for small servers that need a admin only chatroom!

AdminTalk has one command, /a <msg> to chat with your admins, all messages ARE logged!

Source:

Код:
/*
AdminTalk - Your Admin Chatting needs!
Copyright © 2012 iToast / iToasterman

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <a_samp>

#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xAA3333AA

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnFilterScriptInit()
{
	print("AdminTalk by iToast Loaded");
	return 1;
}

public OnFilterScriptExit()
{
	print("AdminTalk by iToast Un-Loaded!");
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(a, 1, cmdtext);
	return false;
}

dcmd_a(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
		new msg[300], name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(msg, sizeof(msg), "[Admin] %s: %s", name, params);
		print(msg);
	    for(new i = 0; i < MAX_PLAYERS; i++)
	    {
			if(IsPlayerAdmin(i))
			{
			    SendClientMessage(i, COLOR_YELLOW, msg);
			}
	    }
	}else{
	    SendClientMessage(playerid, COLOR_RED, "[AdminTalk] You're not in a admin!");
	}
	return 1;
}
This IS a FORK of TeamTalk
Reply
#2

+1 Work
Reply
#3

Good job.
Reply
#4

gj
Reply
#5

That's pretty simple, but nice one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)