[FUNC] ReadMyText Function
#1

[FUNC] ReadMyText Function

I have seen alot of people asking about teamchats and whatever,
I found a SendTeamMessage function but i couldnt find one of these,
So i decided to release one

SENDCLIENTMESSAGE VERSION
pawn Код:
stock ReadMyText(playerid,color,format2[],output[])
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%s): %s", format2, name, output);
SendClientMessage(playerid, color, string);
}
SENDCLIENTMESSAGETOALL VERSION
pawn Код:
stock EveryoneReadMyText(playerid,color,format2[],output[])
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%s): %s", format2, name, output);
SendClientMessageToAll(color, string);
}
Add that outside a callback

Usage:
Код:
ReadMyText(playerid,color,format2[],output[])
Example: ZCMD/DCMD
Код:
ReadMyText(playerid,0xFF0000AA,"Police Radio",params)
Example: CMDTEXT
Код:
ReadMyText(playerid,0xFF0000AA,"Police Radio",cmdtext)
Playerid = playerid
Color = color
Format2[] = Type of radio/teamchat ( Example: If you put Team Chat, Ingame it will show as Team Chat (PLAYERNAME): TEXTHERE )
Output[] = params for dcmd and zcmd, cmdtext for normal onplayercommandtext thing

Ingame format:

FORMAT2[] (PLAYERNAME): TEXT

I suggest using this function also: NOT MADE BY ME

pawn Код:
stock SendTeamMessage(teamid,color,message[])
{
#if defined foreach
foreach(i) {
#else
for(new i=0; i<GetMaxPlayers(); i++) if(IsPlayerConnected(i)) {
#endif
if(GetPlayerTeam(i)==teamid) SendClientMessage(i,color,message);
}
}
Example:
pawn Код:
SendTeamMessage(TEAM_GROVE, COLOR_ORANGE, "SendTeamMessage example");
And on my function replace SendClientMessage with SendTeamMessage and playerid with teamid
Any questions or bugs? Just ask me!

Credits:
Torran - Idea and making the base
[NWA]Hannes - Helping me fix errors
Gamestar. - SendTeamMessage function
Reply


Messages In This Thread
[FUNC] ReadMyText Function - by Torran - 23.02.2010, 19:00
Re: [FUNC] ReadMyText Function - by bajskorv123 - 23.02.2010, 19:01
Re: [FUNC] ReadMyText Function - by Onyx09 - 23.02.2010, 19:20
Re: [FUNC] ReadMyText Function - by Torran - 23.02.2010, 19:21
Re: [FUNC] ReadMyText Function - by Torran - 23.02.2010, 19:45
Re: [FUNC] ReadMyText Function - by bajskorv123 - 23.02.2010, 22:20
Re: [FUNC] ReadMyText Function - by Torran - 23.02.2010, 22:21
Re: [FUNC] ReadMyText Function - by HydraX - 23.02.2010, 22:43
Re: [FUNC] ReadMyText Function - by Torran - 23.02.2010, 22:50
Re: [FUNC] ReadMyText Function - by Fedee! - 23.02.2010, 22:55

Forum Jump:


Users browsing this thread: 1 Guest(s)