[FilterScript] TeamTalk
#1

TeamTalk by iToast

TeamTalk is for small servers with teams already implemented that want to add team chatting without any hastle!

TeamTalk has one command, /t <msg> to chat with your team, all messages ARE logged!

Source:

Код:
/*
TeamTalk - Your Team 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("TeamTalk by iToast Loaded");
	return 1;
}

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

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

dcmd_t(playerid, params[])
{
	if(GetPlayerTeam(playerid) != NO_TEAM)
	{
		new team = GetPlayerTeam(playerid);
		new msg[300], name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(msg, sizeof(msg), "[TeamTalk] %s: %s", name, params);
		print(msg);
	    for(new i = 0; i < MAX_PLAYERS; i++)
	    {
			if(GetPlayerTeam(i) == team)
			{
			    SendClientMessage(i, COLOR_YELLOW, msg);
			}
	    }
	}else{
	    SendClientMessage(playerid, COLOR_RED, "[TeamTalk] You're not in any teams!");
	}
	return 1;
}
Reply
#2

Nice Script Useful for admin chat
Reply
#3

Quote:
Originally Posted by Team_PRO
Посмотреть сообщение
Nice Script Useful for admin chat
Thanks! That'l be one of the next releases!
Reply
#4

Btw How To Create Team
Reply
#5

Quote:
Originally Posted by Team_PRO
Посмотреть сообщение
Btw How To Create Team
This is designed for gamemode that have teams but want to add on a team chat without having to add it in, think of it as a feature that can be enabled / disabled by admins
Reply
#6

Srsly? Licence and copyright stuff for a really simple filterscript that can be created in less than 5 minutes?
Reply
#7

Quote:
Originally Posted by im
Посмотреть сообщение
Srsly? Licence and copyright stuff for a really simple filterscript that can be created in less than 5 minutes?
I've started using GPL v3 on all my releases because I am allowed to. Am I NOT allowed to do it? Because you don't like it. its basically a warning NOT to include any code I write in commercial applications
Reply
#8

Yeah, but this is BASIC code. It's just a BASIC command..
You make me wanna start a commercial application and use your code in it..
Reply
#9

good job!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)