Need some help 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: Need some help here.. (
/showthread.php?tid=232085)
Need some help here.. -
Soumi - 26.02.2011
Hello everyone , i Want to make a Team chat when player type @Text , the other Team members can see it.
I Made this but it didn't work , Please help me !
Код:
public OnPlayerText(playerid, text[])
{
if( (text[0] == '#') && strlen(text) > 1)
{
new str[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
if(GetPlayerTeam(playerid) == 1)
{
format(str, 128, "*Team Chat* %s Says : %s", pName, text[1]);
for(new iPlayerID; iPlayerID < MAX_PLAYERS; iPlayerID++)
{
if(!IsPlayerConnected(iPlayerID)) continue;
if(GetPlayerTeam(playerid) == 1) continue;
SendClientMessage(iPlayerID, 0x33AA33AA, str);
}
}
return 0;
}
return 1;
}
Thanks !
Soumi
Re : Need some help here.. -
Soumi - 26.02.2011
Anybody can Help me?
Re: Need some help here.. -
(SF)Noobanatior - 27.02.2011
here you go like this i belive
pawn Код:
public OnPlayerText(playerid, text[])
{
if( (text[0] == '#') && strlen(text) > 1)
{
new str[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, 128, "*Team Chat* %s Says : %s", pName, text[1]);
for(new iPlayerID; iPlayerID < MAX_PLAYERS; iPlayerID++){
if(!IsPlayerConnected(iPlayerID)) continue;
if(GetPlayerTeam(playerid) == GetPlayerTeam(iPlayerID)) SendClientMessage(iPlayerID, 0x33AA33AA, str);
}
return 0;
}
return 1;
}
should work for all teams now too
Re : Need some help here.. -
Soumi - 27.02.2011
Thanks