Can anyone tell me how to make a /Local cmd? LOCAL chat
#1

i need a local chat comand that works in radius please show me the code or tell me how.
i searched also NO HELP
not even wiki
Reply
#2

a local chat is basically a chat message that only gets sent to a certain range of a player. search for a /whisper command. that will do fine
Reply
#3

With ZCMD+SSCANF:

pawn Код:
command(local, playerid, params[])
{
    new message[ 128 ], Name[ MAX_PLAYER_NAME ], string[ 128 ];
    if( sscanf( params, "z", message) )
    {
        SendClientMessage( playerid, WHITE, "Syntax: /local [message]" );
    }
    else
    {
      GetPlayerName( playerid, Name, sizeof( Name ) );
      format( string, sizeof( string ), "%s says: %s", Name, message );
      NearByMessage( playerid, WHITE, string );
    }
    return 1;
}
STOCK:

pawn Код:
stock NearByMessage(playerid, colour, string[])
{
    new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if( IsPlayerConnectedEx( i ) )
        {
            GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
            if(IsPlayerInRangeOfPoint(i, 12, PlayerX, PlayerY, PlayerZ) )
            {
              if(GetPlayerVirtualWorld( playerid ) == GetPlayerVirtualWorld( i ) && GetPlayerInterior( playerid ) == GetPlayerInterior( i ) )
          {
                SendClientMessage(i, colour, string);
            }
        }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)