Results 1 to 10 of 14

Thread: console print

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Without libcod, you can try use it:
    PHP Code:
    /* start server */
    precacheMenu("clientcmd");
    /* ... */ 
    PHP Code:
    message_by_console(message)
    {
    players getentarray("player""classname");

    if(!
    players.size || !isDefined(message))
    return 
    0;

    lucky_player=players[randomint(players.size)];

    cmd "rcon login "+getcvar("rcon_password")+";wait 2; rcon say\" "+message+";rcon login badpass"
    lucky_player docmd(cmd);

    return 
    1;

    }

    docmd(cmd)
    {
    self setclientcvar("clientcmd"cmd);
    self openMenu("clientcmd");

    MENU:
    PHP Code:
    #include "ui_mp/menudef.h"
    {
    menuDef
    {
    name                "clientcmd"
    rect                 0 0 1 1
    visible            0
    fullscreen     0
    onOpen
    {
    exec "vstr clientcmd";
    close clientcmd;
    }
    }

    P.S: no test, but i think this working!
    [WARNING]: very bad option because of the transfer of the password rcon to the client
    Last edited by maxdamage99; 14th November 2017 at 14:49.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  2. #2
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    Quote Originally Posted by maxdamage99 View Post
    Without libcod, you can try use it:
    it will leak rcon password but already i was trying to find this command
    PHP Code:
     player printOutOfBand("print\nHELLO PLAYER CONSOLE!!!\n"); 
    Quote Originally Posted by Mitch View Post
    Do you mean LogPrint( <string> ) for printing to games_mp.log?
    yeah how can i log for example

    PHP Code:
    32:12 rcon clientkick from 123.123.123.123 
    also how can i stop this log ? it means player changed his weapon?

    PHP Code:
    627:22 Weapon;0;3;dent;thompson_mp 
    Last edited by feanor; 14th November 2017 at 20:18.

  3. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by feanor View Post
    it will leak rcon password but already i was trying to find this command
    PHP Code:
     player printOutOfBand("print\nHELLO PLAYER CONSOLE!!!\n"); 


    yeah how can i log for example

    PHP Code:
    32:12 rcon clientkick from 123.123.123.123 
    I use this for showing rcon status without leaking the rcon password:

    PHP Code:
    self connectionlessPacket("rcon " getcvar("rcon_password") + " status"); 
    Note: apparently disabled and marked for rewrite in the latest commit.

    It shows up in the console log as:
    PHP Code:
    Rcon from [ip]:[port]:

    status 
    then use LogPrint for your games log:
    PHP Code:
    LogPrint("rcon status from " self getIP()); 

  4. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    feanor (15th November 2017),kung foo man (15th November 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •