Kinda new here. - 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: Kinda new here. (
/showthread.php?tid=67520)
Kinda new here. -
harly - 01.03.2009
Код:
#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)
Re: Kinda new here. -
x-cutter - 02.03.2009
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]
Re: Kinda new here. -
Rks25 - 02.03.2009
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;
}
Re: Kinda new here. -
harly - 02.03.2009
what would the command be to talk in gang chat now>
Re: Kinda new here. -
Rks25 - 02.03.2009
you need to do , not /chat or something but:
, [text]
Re: Kinda new here. -
harly - 02.03.2009
huh, sorry i dont get you
Re: Kinda new here. -
Rks25 - 02.03.2009
Press T in game to enable chat box.
Type , hello
And it will send hello to your team.
Re: Kinda new here. -
harly - 02.03.2009
How would i change that to T
/g [text]
Re: Kinda new here. -
Rks25 - 02.03.2009
By makign a cmd of what i just gave..
Re: Kinda new here. -
harly - 02.03.2009
And what would the command look like?
Re: Kinda new here. -
Rks25 - 02.03.2009
Please learn scripting, look for things, search.
Re: Kinda new here. -
Zeromanster - 02.03.2009
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
Re: Kinda new here. -
Rks25 - 03.03.2009
He can make it a command if he wants.