TeamChat help please
#1

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;
}
Reply
#2

I also don't know what's wrong since you don't post your errors and such.
Reply
#3

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
Reply
#4

Why you don't make a chat OnPlayerText with symbol # * or @
Reply
#5

But i need make it /f please, how? give me code
Reply
#6

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;
}
Reply
#7

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)