17.08.2015, 20:34
use assim
PHP код:
foreach(Player, i)
{
if( pInfo[ i ][ Logado ] == true )
{
if( aInfo[ playerid ][ Admin ] == 0 && aInfo[ playerid ][ Moderador ] == 0 && pInfo[ playerid ][ PLAYER_VIP ] == 0 )
{
strmid( tmp, text, 0, strlen( text ));
if( strlen( tmp ) > 65 )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Mensagem muito grande !" );
return 0;
}
else
{
new
Float:chatX, Float:chatY, Float:chatZ
;
GetPlayerPos( playerid, chatX, chatY, chatZ );
if(aInfo[ i ][ Admin ] == 1 && pInfo[ i ][ vchat ] == 1 || aInfo[ i ][ Moderador ] == 1 && pInfo[ i ][ vchat ] == 1 )
{
format( gstring, sizeof( gstring ), "• [ %d ] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
if( pInfo[ playerid ][ Level ] < 4 && aInfo[ i ][ Admin ] == 1 || pInfo[ playerid ][ Level ] < 4 && aInfo[ i ][ Moderador ] == 1 )
{
format( gstring, sizeof( gstring ), "• ( N ) [ %d ] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
if( pInfo[ playerid ][ Level ] > 4 && aInfo[ i ][ Admin ] == 1 && pInfo[ i ][ vchat2 ] == 1 || aInfo[ i ][ Moderador ] == 1 && pInfo[ i ][ vchat2 ] == 1 )
{
format( gstring, sizeof( gstring ), "• [ %d ] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
}
}
else
{
new
Float:chatX, Float:chatY, Float:chatZ
;
GetPlayerPos( playerid, chatX, chatY, chatZ );
if( aInfo[ playerid ][ Admin ] == 1 )
{
strmid( tmp, text, 0, strlen( text ));
format( gstring, sizeof( gstring ), "® [ %d ] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
if( pInfo[ playerid ][ chat ] == 0 )
{
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
if( pInfo[ playerid ][ chat ] == 1 )
{
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
}
if( aInfo[ playerid ][ Gerente ] == 1 )
{
strmid( tmp, text, 0, strlen( text ));
format( gstring, sizeof( gstring ), "® [ %d ] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
if( pInfo[ playerid ][ chat ] == 0 )
{
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
if( pInfo[ playerid ][ chat ] == 1 )
{
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
}
if( aInfo[ playerid ][ Moderador ] == 1 )
{
strmid( tmp, text, 0, strlen( text ));
format( gstring, sizeof( gstring ), "© [ %d ] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
if( pInfo[ playerid ][ chat ] == 0 )
{
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
if( pInfo[ playerid ][ chat ] == 1 )
{
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
}
if( pInfo[ playerid ][ PLAYER_VIP ] == 1 && aInfo[ playerid ][ Admin ] == 0 )
{
strmid( tmp, text, 0, strlen( text ));
format( gstring, sizeof( gstring ), "• [ %d ] [VIP] %s{FFFFFF} %s", playerid, PlayerName( playerid ), tmp );
SendClientMessage( i, GetPlayerColor( playerid ), gstring );
}
}
}
}
format( digitouChat[ playerid ], 128, "%s", text );
return 0;
}