/low won't work?
#1

This is my /low command:

pawn Код:
stock SendClosestMessage( playerid, color, const string[ ] )

{
    new
        Float: jPos[ 3 ]
    ;

    GetPlayerPos( playerid, jPos[ 0 ], jPos[ 1 ], jPos[ 2 ] );

    for ( new j = GetMaxPlayers( ), i; i < j; i ++ )
    {
        if ( !IsPlayerConnected( i ) )
            continue;

        if ( IsPlayerInRangeOfPoint( i, 7.0, jPos[ 0 ], jPos[ 1 ], jPos[ 2 ] ) )
        {
            SendClientMessage( i, color, string );
        }
    }

    return 1;
}

stock RemoveUnderScore(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if ( !strcmp( cmdtext, "/low", true, 3 ) )
    {
        if ( cmdtext[ 3 ] != ' ' || !cmdtext[ 4 ] )
            return SendClientMessage( playerid, -1, "SERVER: /low <text>" );

        new
            tempString[ 128 ],
            pName[ 24 ]
        ;

        GetPlayerName( playerid, pName, sizeof pName );

        format( tempString, sizeof tempString, "*%s says [Low]: %s", RemoveUnderScore(playerid), cmdtext[ 3 ] );

        SendClosestMessage( playerid, COLOR_WHITE, tempString );

        return 1;
    }
    return 0;
}
Whenever I type just "/low" in-game, it comes up saying: "SERVER: /low <text>" which is perfectly fine. But whenever I add text to the command, say for example: "/low Hello" it will come up with: "SERVER: /low <text>"

Any help, please?
Reply


Messages In This Thread
/low won't work? [SOLVED/FIXED] - by Gramercy Riffs - 15.07.2011, 12:32
Re: /low won't work? - by CyNiC - 15.07.2011, 12:36
Re: /low won't work? - by Gramercy Riffs - 15.07.2011, 12:39
Re: /low won't work? - by CyNiC - 15.07.2011, 12:48
Re: /low won't work? - by Gramercy Riffs - 15.07.2011, 12:52
Re: /low won't work? - by Gramercy Riffs - 15.07.2011, 13:28

Forum Jump:


Users browsing this thread: 1 Guest(s)