team 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)
+--- Thread: team chat! ^ (
/showthread.php?tid=414153)
team chat! ^ -
karni357 - 08.02.2013
How can I do that once they do the caret ^ then it will send a message to a team you are coming but it will be for five teams and other groups not be seen the message you sent in your team?
PHP код:
new string[128];
if(text[0] == '^')
{
format(string,sizeof(string),"[Police] %s[id: %d]: %s",GetName(playerid),playerid,text[1]);
for(new i = 0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && Policee[i] == 1) SendClientMessage(i,0x0033ffff,string); return 0; }
}
return 1;
I have 6 teams and these are their options:
Policee [playerid] = 1;
Yakoza [playerid] = 1;
Drifterss [playerid] = 1;
CasinoM [playerid] = 1;
HomeLesss [playerid] = 1;
TheGaragee [playerid] = 1;
thanks alot for whos will help me
Re: team chat! ^ -
Jewell - 08.02.2013
why you don't use gTeam or something. it's easy than this.
but Try this code
pawn Код:
new string[128];
if(text[0] == '^')
{
format(string,sizeof(string),"[TEAM CHAT] %s[id: %d]: %s",GetName(playerid),playerid,text[1]);
if( Policee[playerid] == 1)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && Policee[i] == 1) SendClientMessage(i,GetPlayerColor(playerid),string);
}
return 0;
}
if(Yakoza [playerid] == 1)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && Yakoza [i] == 1) SendClientMessage(i,GetPlayerColor(playerid),string);
}
return 0;
}
if( Drifterss [playerid] == 1)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && Drifterss [i] == 1) SendClientMessage(i,GetPlayerColor(playerid),string);
}
return 0;
}
if( CasinoM [playerid] == 1)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && CasinoM [i] == 1) SendClientMessage(i,GetPlayerColor(playerid),string);
}
return 0;
}
if( HomeLesss[playerid] == 1)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && HomeLesss[i] == 1) SendClientMessage(i,GetPlayerColor(playerid),string);
}
return 0;
}
if( TheGaragee [playerid] == 1)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && TheGaragee [i] == 1) SendClientMessage(i,GetPlayerColor(playerid),string);
}
return 0;
}
}
return 1;