20.11.2011, 11:15
Here you go:
pawn Code:
CMD:family(playerid, params[])
{
if ( isnull ( params ) ) return SendClientMessage( playerid, -1, #Usage /family <text> );
new
pName[ MAX_PLAYER_NAME ],
_message[ 128 ]
;
GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
if ( PlayerInfo[ playerid ][ pLider ] == 5 || PlayerInfo[ playerid ][ pMember ] == 5 )
{
format( _message, sizeof ( _message ), "[Family nr.5] %s: %s", pName, params );
for ( new i = 0; i != MAX_PLAYERS; ++i )
{
if ( PlayerInfo[ i ][ pLider ] == 5 || PlayerInfo[ i ][ pMember ] == 5 )
SendClientMessage( i, -1, _message );
}
}
else if ( PlayerInfo[ playerid ][ pLider ] == 4 || PlayerInfo[ playerid ][ pMember ] == 4 )
{
format( _message, sizeof ( _message ), "[Family nr.4] %s: %s", pName, params );
for ( new i = 0; i != MAX_PLAYERS; ++i )
{
if ( PlayerInfo[ i ][ pLider ] == 4 || PlayerInfo[ i ][ pMember ] == 4 )
SendClientMessage( i, -1, _message );
}
}
else return SendClientMessage( playerid, -1, #You are not in a family );
return ( 1 );
}