help with chat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with chat (
/showthread.php?tid=186202)
help with chat -
marinov - 28.10.2010
How do I make a /r chat for the team (id 6) ?
Re: help with chat -
mrmuffins - 28.10.2010
Just an example:
pawn Код:
COMMAND:r(playerid, params[]) {
new string[128];
if (GetPlayerTeam(playerid) != 6) return SendClientMessage(playerid, COLOR_RED, "Your Not Team 6!");
if (sscanf(params, "s", string)) return SendClientMessage(playerid, COLOR_RED, "/r <message>");
for (new i = 0; i < MAX_PLAYERS; i++) {
if (GetPlayerTeam(i) == 6) {
new name[24]; GetPlayerName(i, name, 24);
format(string, 128, "TEAM %s: %s", name, string);
SendClientMessage(i, COLOR_WHITE, string);
}
}
return 1;
}
Basically check if their team is 6, if so, get the parameter, the 'string' or message.
Then send it to everyone who's on team 6.