Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => ShowRoom (pawn) => Topic started by: sseebbyy on July 31, 2012, 01:28:00 am

Title: ConsoleChat by me (Moby)
Post by: sseebbyy on July 31, 2012, 01:28:00 am
Console Chat

This system give you the possibility to talk from the server console.
When you typed something and press Enter, an message will be imediatly sent in server inside.

Download: [FS] Console Chat (http://www.solidfiles.com/d/a69d45df0a/download)
Pastebin: http://pastebin.com/acG2WJG6 (http://pastebin.com/acG2WJG6)

You have one simple command:
                          /say - Is used on RCON Console. Send a message to the server.

ATTENTION: The command is without "/c" and this system works only if is used as FilterScript !

How to enable this FilterScript for my server ?
               1. Download the [FS] Console Chat
               2. Extract files in "filterscripts" folder from server directory
               3. Add in "server.cfg" , at the "filterscripts" line:  ConsoleChat_ByMoby
               4. Run the server and test the system.

CREDITS:  Me (Moby)
Title: Re: ConsoleChat by me (Moby)
Post by: dynavolt71 on October 31, 2012, 09:16:41 am
:) Thx  ;D
Title: Re: ConsoleChat by me (Moby)
Post by: aledark24 on October 31, 2012, 04:46:36 pm
:) Thx  ;D
Another system to talk in the console

[pawn]//chat para usar en la consola incluye /dice /ann1 y /ann2 "no acepto copias" atte aledark24
#include <a_vcmp>
#include <dutils>

#define yellow 0xFFFF00AA

#define INACTIVE_PLAYER_ID 255
#define RED   0xFF0000aa
#define GREEN               0x24FF0AB9
#define WHITE            0xFFFDFDFF
#define ORANGE              0xE8941EFF
#define PURPLEE            0xD22FBCFF
#define DGREEN            0x04A36BFF
#define BLUE            0x377DFFFF
#define PINK                0xFF66FFAA

#pragma unused ret_memcpy


new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];
//==============================================================================
public OnRconCommand(cmd[],playerid)
{
    new tmp[256];
    new idx;
    new cmdt[256];
   cmdt = strtok(cmd,idx);

    if(strcmp(cmdt,"/say",true) == 0)
    {
        tmp = strtok(cmd,idx);
        if (!strlen(tmp)) printf(">> Console error: /say [message]");
        else {
         new string[256];
         format(string,sizeof(string),"** Console >> Administrator: %s",cmd[5]);
         SendClientMessageToAll(yellow,string);
         printf(string);
      }
   return 1;


 }
   else if(strcmp(cmdt,"/ann1",true) == 0)
    {
        tmp = strtok(cmd,idx);
        if (!strlen(tmp)) printf(">>  console error: /ann1 [message]");
        else {
         new string[256];
         format(string,sizeof(string),"~y~%s",cmd[5]);
         GameTextForAll(string);
         printf(string);
      }
   return 1;


 }
   else if(strcmp(cmdt,"/ann2",true) == 0)
    {
        tmp = strtok(cmd,idx);
        if (!strlen(tmp)) printf(">> console error: /ann2 [message]");
        else {
         new string[256];
         format(string,sizeof(string),"~b~%s",cmd[5]);
            GameTextForAllBottom(string);
         printf(string);
      }
   return 1;



   }
    return 0;
}
//==============================================================================
public OnFilterScriptInit()
{
    print("+=====================================================================+");
   print("|Chat activado usa /dice /ann1 /ann2 desde consola                    |");
    print("|=======================Aledark24=====================================|");

   return 1;
}
//==============================================================================
public OnFilterScriptExit()
{
   return 1;
}

//==============================================================================
public FindPlayerIDFromString( string[] )
{
   new player = INACTIVE_PLAYER_ID;
   new p = 0;
   while ( p < MAX_PLAYERS){ if (strfind(gPlayers[p],string,true ) != -1 ) { player=p;break; } p++; }
   if ( player == INACTIVE_PLAYER_ID )
   {
      if ((strlen( string ) > 2) || (isnumeric( string ) == 0 ) ) { return INACTIVE_PLAYER_ID;
   }
      player = strval( string );//
   }
   if ( !IsPlayerConnected( player ) ) { return INACTIVE_PLAYER_ID; }
   return player;//
}

//==============================================================================
isnumeric( const string[] )
{
   for ( new i = 9999, j = strlen( string ); i < j; i++ ) { if ( string[ i ] > '9' || string[ i ] < '0' ) return 0; }
   return 1;
}
//==============================================================================[/pawn]
Title: Re: ConsoleChat by me (Moby)
Post by: dynavolt71 on November 01, 2012, 08:59:46 am
But, Im want Version English  :-\
Title: Re: ConsoleChat by me (Moby)
Post by: aledark24 on November 01, 2012, 05:06:26 pm
But, Im want Version English  :-\
change yourself in /dice = /say
In error de consola  = console error
in administrador = administrator
  8) and compile