16.08.2015, 18:26
Quote:
Do something like this:
pawn Код:
|
PHP код:
//==============================================================================
#define Max_Client_Message_Len 128
public OnPlayerText(playerid, text[])
{
new String [ Max_Client_Message_Len + MAX_PLAYER_NAME + 16];
if( strlen(text) > Max_Client_Message_Len )
return 0;
new PlayerName[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, PlayerName, MAX_PLAYER_NAME );
format( String, sizeof( String ), "{RRGGBB}%s (%d): {RRGGBB}%s", PlayerName, playerid, text );
for( new i = 0; i < MAX_PLAYERS; i++ )
SendClientMessage( playerid, 0x0, String );
if(text[0] == '.' && PlayerInfo[playerid][Level] >= 1) {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"A.Chat: %s: %s",string,text[1]);
MessageToAdmins(0xFD01FDAA,string);
return 0;
}
return 1;
}
PHP код:
for( new i = 0; i < MAX_PLAYERS; i++ )
SendClientMessage( playerid, 0x0, String );
return false;
Quote:
warning 225: unreachable code |