23.02.2010, 19:00
[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
SENDCLIENTMESSAGETOALL VERSION
Add that outside a callback
Usage:
Example: ZCMD/DCMD
Example: 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
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
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);
}
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);
}
Usage:
Код:
ReadMyText(playerid,color,format2[],output[])
Код:
ReadMyText(playerid,0xFF0000AA,"Police Radio",params)
Код:
ReadMyText(playerid,0xFF0000AA,"Police Radio",cmdtext)
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);
}
}
pawn Код:
SendTeamMessage(TEAM_GROVE, COLOR_ORANGE, "SendTeamMessage example");
Any questions or bugs? Just ask me!
Credits:
Torran - Idea and making the base
[NWA]Hannes - Helping me fix errors
Gamestar. - SendTeamMessage function