02.01.2013, 19:30
The code:
pawn Code:
public OnPlayerText ( playerid, text[] )
{
new
Float: charPos [ 3 ],
chatStr [ 128 ],
plUserName [ MAX_PLAYER_NAME ];
GetPlayerPos ( playerid, charPos [ 0 ], charPos [ 1 ], charPos [ 2 ] );
GetPlayerName ( playerid, plUserName, MAX_PLAYER_NAME );
for( new user; user < MAX_PLAYERS; user ++ )
{
if( IsPlayerInRangeOfPoint ( user, 20.0, charPos [ 0 ], charPos [ 1 ], charPos [ 2 ] ) )
{
if( GetPlayerVirtualWorld ( user ) == GetPlayerVirtualWorld ( playerid ) )
{
format ( chatStr, 128, ""#INT_CHARACTERNAME"%s "#INT_GREY"says: "#INT_WHITE"%s", plUserName, text );
SendClientMessage ( user, -1, chatStr );
format ( chatStr, 128, ""#INT_GREY"DEBUG: "#INT_WHITE"Character Count: "#INT_CHARACTERNAME"%d", 61 + strlen ( text ) );
SendClientMessage ( playerid, -1, chatStr );
return false;
}
}
}
return 1;
}