Kinda new here.
#1

Код:
#define TEAM_ITALIAN 1
#define TEAM_ITALIAN_COLOR 0x00FF00AA // Green
new gTeam[MAX_PLAYERS];
That is my code, how would i make a "chat" for that team
http://pastebin.com/me2006a1
Here is my script (Not my real one, this is a test for this perticular piece of work)
Reply
#2

Quote:
Originally Posted by harly
Код:
#define TEAM_ITALIAN 1
#define TEAM_ITALIAN_COLOR 0x00FF00AA // Green
new gTeam[MAX_PLAYERS];
That is my code, how would i make a "chat" for that team
http://pastebin.com/me2006a1
Here is my script (Not my real one, this is a test for this perticular piece of work)
search, or use SetPlayerTeam and GetPlayerTeam instead of gTeam and use /tpm [text]
Reply
#3

or just do a simple thing at onplayertext like:
pawn Код:
if(text[0] == ',')
{
  if (gTeam[playerid] == TEAM_ITALIAN)
  {
    new String[128],pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(String, 128, "[ITALIAN] %s(%d): %s", pname, playerid, text[1]);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
      if (gTeam[i] == TEAM_ITALIAN)
      {
        SendClientMessage(i, COLOR_COLOR, String);
      }
    }
  }
  else
  {
    SendClientMessage(playerid, COLOR_COLOR, "* You are not an Italiano.");
  }
  return 0;
}
Reply
#4

what would the command be to talk in gang chat now>
Reply
#5

you need to do , not /chat or something but:
, [text]
Reply
#6

huh, sorry i dont get you
Reply
#7

Press T in game to enable chat box.
Type , hello
And it will send hello to your team.
Reply
#8

How would i change that to T

/g [text]
Reply
#9

By makign a cmd of what i just gave..
Reply
#10

And what would the command look like?
Reply
#11

Please learn scripting, look for things, search.
Reply
#12

Quote:
Originally Posted by Rks_
or just do a simple thing at onplayertext like:

if(text[0] == ',')
{
if (gTeam[playerid] == TEAM_ITALIAN)
{
new String[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(String, 128, "[ITALIAN] %s(%d): %s", pname, playerid, text[1]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if (gTeam[i] == TEAM_ITALIAN)
{
SendClientMessage(i, COLOR_COLOR, String);
}
}
}
else
{
SendClientMessage(playerid, COLOR_COLOR, "* You are not an Italiano.");
}
return 0;
}
Change the , to your text... now the member of Italian Team has to type , before the message... or

Quote:
Originally Posted by Rks_
or just do a simple thing at onplayertext like:

if(text[0] == '!')
{
if (gTeam[playerid] == TEAM_ITALIAN)
{
new String[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(String, 128, "[ITALIAN] %s(%d): %s", pname, playerid, text[1]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if (gTeam[i] == TEAM_ITALIAN)
{
SendClientMessage(i, COLOR_COLOR, String);
}
}
}
else
{
SendClientMessage(playerid, COLOR_COLOR, "* You are not an Italiano.");
}
return 0;
}
the member of the Italian Team has to type in ! before every message ...

I hope you get i now

Reply
#13

He can make it a command if he wants.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)