See the /me command in 5 meters
#10

Quote:
Originally Posted by Mean
Посмотреть сообщение
pawn Код:
if (strcmp("/me", cmdtext, true, 3) == 0)
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos( i, x, y, z );
        if ( IsPlayerInRangeOfPoint ( i, 5.0, x, y, z ) ) // You can always change the range
        {
            if ( i == playerid ) continue;
            new string[ 128 ];
            new pName[ MAX_PLAYER_NAME ];
            GetPlayerName( playerid, pName, sizeof pName );
            format( string, sizeof string, "%s %s", pName, cmdtext );
            SendClientMessage( i, 0xAAAAAA, string );
        }
    }
    return 1;
}
Please test your code before you post. That code will send the message to every loop itteration in range of their own position. Also, please do not post finished code to people like this. They'll come to this section and ask basic questions like this all the time because they do not learn anything by people like you giving them finished code.

Also, to topic poster. I see no reason to use strcmp as a command processor. There are better ones out there, so why not use them? Or wait, you downloaded The Godfather script, edited it and claimed it as your own. And now you use and learn from the bad code in that script.
Reply


Messages In This Thread
See the /me command in 5 meters - by davelord - 11.02.2011, 15:01
Re: See the /me command in 5 meters - by [03]Garsino - 11.02.2011, 15:10
Re: See the /me command in 5 meters - by davelord - 11.02.2011, 15:38
Re: See the /me command in 5 meters - by [03]Garsino - 11.02.2011, 15:46
Re: See the /me command in 5 meters - by Popz - 11.02.2011, 15:48
Re: See the /me command in 5 meters - by Mean - 11.02.2011, 15:53
Re: See the /me command in 5 meters - by jameskmonger - 11.02.2011, 15:59
Re: See the /me command in 5 meters - by davelord - 11.02.2011, 16:12
Re: See the /me command in 5 meters - by Mean - 11.02.2011, 16:15
Re: See the /me command in 5 meters - by [03]Garsino - 11.02.2011, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)