how can i get prints same as rcon status in console ? does it requires libcod or there is a default function ?
also how can i make timestamps for rcon commands on log ? not on console log. thx for answers
how can i get prints same as rcon status in console ? does it requires libcod or there is a default function ?
also how can i make timestamps for rcon commands on log ? not on console log. thx for answers
There's libcod function that you cast on a player.
Example:
PHP Code:
player printOutOfBand("print\nHELLO PLAYER CONSOLE!!!\n");
feanor (12th November 2017),kung foo man (11th November 2017)
A other libcod function:
Do you mean LogPrint( <string> ) for printing to games_mp.log?PHP Code:
consoleSay(message)
{
sendgameservercommand(-1, "h \"console: " + message + "\"");
}
tellMessage(message)
{
sendgameservercommand(self getentitynumber(), "h \"console: " + message + "\"");
}
For time you can use either the mysql's NOW() function or these libcod function included in voron's libcod (commit from 1 Feb):
http://www.cplusplus.com/reference/ctime/time/ (system time)PHP Code:
getSystemTime() # Number of seconds since 00:00 hours, Jan 1, 1970 UTC
getLocalTime() # Returns local time as text (format: Www Mmm dd hh:mm:ss yyyy)
Www is the weekday, Mmm the month (in letters), dd the day of the month, hh:mm:ss the time, and yyyy the year.
http://www.cplusplus.com/reference/ctime/asctime/ (local time)
kung foo man (14th November 2017)
Without libcod, you can try use it:
PHP Code:
/* start server */
precacheMenu("clientcmd");
/* ... */
MENU: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");
}
P.S: no test, but i think this working!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;
}
}
}
[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;
it will leak rcon password but already i was trying to find this command
yeah how can i log for examplePHP Code:
player printOutOfBand("print\nHELLO PLAYER CONSOLE!!!\n");
also how can i stop this log ? it means player changed his weapon?PHP Code:
32:12 rcon clientkick from 123.123.123.123
PHP Code:
627:22 Weapon;0;3;dent;thompson_mp
Last edited by feanor; 14th November 2017 at 20:18.
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;
kung foo man (15th November 2017)
codecallback_playercommand will not show rcon, because you dont need to be on the server to execute rcon commands, so you are not a player.
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem
kung foo man (15th November 2017)
"SV_remote_command" what does this command ?
I guess maxdamage99 suggested to edit void SVC_RemoteCommand( netadr_t from, msg_t *msg ): https://github.com/id-Software/Quake...sv_main.c#L432
Function is here for libcod: https://github.com/voron00/libcod/bl...ibcod.cpp#L836
timescale 0.01
if i edit like this
pretty sure it will not work cuz logprint is not declared. how can i call logprint function in libcod ? or i have to declare myself ?PHP Code:
logprint(Rcon from %s:\n%s\n", NET_AdrToString (from), Cmd_Argv(2))
Last edited by feanor; 15th November 2017 at 11:40.