TeamChat help please - 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: TeamChat help please (
/showthread.php?tid=293921)
TeamChat help please -
pandaeyez - 30.10.2011
I got a problem with Team Chat.. i dont know what is wrong?
Код:
public OnPlayerCommandText(playerid, cmd[])
{
if(strcmp(cmd, "/f", true, 0)==0)
{
new string[128]; GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "*TeamChat %s: %s", string, text[1]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
return 1;
}
Re: TeamChat help please -
Kingunit - 30.10.2011
I also don't know what's wrong since you don't post your errors and such.
Re: TeamChat help please -
pandaeyez - 30.10.2011
5 errors here
error 025: function heading differs from prototype
error 017: undefined symbol "text"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Re: TeamChat help please -
Kostas' - 30.10.2011
Why you don't make a chat OnPlayerText with symbol # * or @
Re: TeamChat help please -
pandaeyez - 30.10.2011
But i need make it /f please, how? give me code
Re: TeamChat help please -
Edvin - 30.10.2011
pawn Код:
if ( strcmp( cmdtext, "/f", true ) == 10 )
{
if ( sscanf( cmdtext, "s[128]", cmdtext[ 0 ] ) ) return SendClientMessage( playerid, GetPlayerColor( playerid ), "USAGE: /f [Text]" );
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), cmdtext[0]);
}
return 1;
}
Re: TeamChat help please -
pandaeyez - 30.10.2011
Quote:
Originally Posted by Edvin
pawn Код:
if ( strcmp( cmdtext, "/f", true ) == 10 ) { if ( sscanf( cmdtext, "s[128]", cmdtext[ 0 ] ) ) return SendClientMessage( playerid, GetPlayerColor( playerid ), "USAGE: /f [Text]" ); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), cmdtext[0]); } return 1; }
|
But it doesnt work?