Emergency services radio
#3

I don't know why, but try :

pawn Код:
if ( !strcmp( cmdtext, "/e", true, 2 ) )
{
    if ( gTeam[ playerid ] == TEAM_COP || gTeam[ playerid ] == TEAM_WSPD || gTeam[ playerid ] == TEAM_FBI || gTeam[ playerid ] == TEAM_MEDIC || gTeam[ playerid ] == TEAM_FIREMAN )
    {
        if ( cmdtext[ 2 ] != ' ' || !cmdtext[ 3 ] )
            return SendClientMessage( playerid, -1, "{FF0000}USAGE: {AAAAAA}/e [ text ]" );

        new
            tempName[ 24 ],
            tempString[ 128 ]
        ;

        GetPlayerName( playerid, tempName, sizeof ( tempName );

        format( tempString, sizeof ( tempString ), "* Radio %s( %i ): %s, over.", tempName, playerid, cmdtext[ 2 ] );

        SendCopMessage( COLOR_BLUE, string );

        return 1;
    }
    else return SendClientMessage( playerid, -1, "{FF0000}ERROR: {AAAAAA}You are not in the correct team." );

    return 1;
}
Or, somethings wrong with the SendCopMessage function?

pawn Код:
stock SendCopMessage( color, const string[ ] )
{
    for ( new j = GetMaxPlayers( ), i; i < j; i ++ )
    {
        if ( !IsPlayerConnected( i ) )
            continue;

        if ( gTeam[ i ] == TEAM_COP || gTeam[ i ] == TEAM_WSPD || gTeam[ i ] == TEAM_FBI || gTeam[ i ] == TEAM_MEDIC || gTeam[ i ] == TEAM_FIREMAN )
        {
            SendClientMessage( i, color, string );
        }
    }

    return 1;
}
EDIT: Just added an example of a "SendCopMessage function".
Reply


Messages In This Thread
Emergency services radio - by McCarthy - 12.07.2011, 10:31
Re: Emergency services radio - by Lorenc_ - 12.07.2011, 10:36
Re: Emergency services radio - by Basicz - 12.07.2011, 10:38

Forum Jump:


Users browsing this thread: 1 Guest(s)