PDA

View Full Version : I want rcon status showing in console..



suck000
13th April 2016, 05:38
case "status":
if(self getGUID() == XXXXX)
{
Cmd_ExecuteString( "status" );
thread tellMessage("^7Check Console !");
}
else
{
thread tellmessage("^7You are not an admin.");
self.name iprintlnbold("Don't try ^1ADMINS COMMANDS ^7again.");
return;
}

The problem is that in my console , nothing appears ! either if i do Shit+² , but nothing there ...

IzNoGoD
13th April 2016, 05:40
Because its serverside.

suck000
13th April 2016, 05:42
Yes i see ... how to fix it please ?
Thanks for your quick responce !

kung foo man
13th April 2016, 08:06
I guess the easiest would be to hook Com_Printf with a little function, which appends all the output of it to a temporary string:



hook_com_printf_to_save_output_to_string();
Cmd_ExecuteString( "status" );
ret = get_saved_com_printf_string_and_unhook_com_printf( );


But that's not implemented yet.

Ni3ls
13th April 2016, 10:36
Use the clientcmd to execute a command.
"rcon "+ getcvar(rcon_password) + " status"

Something like that, dont know the exact command

suck000
13th April 2016, 10:37
I got unknown function error kung

unknown function: (file 'maps/mp/gametypes/_callbacksetup.gsc', line 424)
ret = get_saved_com_printf_string_and_unhook_com_printf( );

Mitch
13th April 2016, 10:44
Use the clientcmd to execute a command.
"rcon "+ getcvar(rcon_password) + " status"

Something like that, dont know the exact command

This is executed from the serverside
https://znation.nl/cod4script/connectionlesspacket.htm



But that's not implemented yet.


I got unknown function error kung

unknown function: (file 'maps/mp/gametypes/_callbacksetup.gsc', line 424)
ret = get_saved_com_printf_string_and_unhook_com_printf( );

suck000
13th April 2016, 10:44
Ni3ls it didn"t work , nothing in the ingame console :S

suck000
13th April 2016, 10:55
@Mitch , i replaced player with self and i got it working ! Thanks ! <3

suck000
13th April 2016, 11:56
I know this is off-topic , but can you please help me ? am trying to do a !pm command .. i don't know how to start can you help me ? :p

Ni3ls
13th April 2016, 12:47
just stop...

Whiskas
13th April 2016, 13:28
You can use this function:


sendgameservercommand(id, "h \"^7PM: " + message + "\"");

Where id is an entity number of player who get the message displayed.

voron00
13th April 2016, 14:39
Maybe just
self connectionlessPacket("rcon " + getcvar("rcon_password") + " status");

Edit: oh well, Mitch posted it already, my bad, can hardly read stuff from this mobile phone.

suck000
13th April 2016, 15:50
I got an error !

uninitialised variable 'message': (file 'maps/mp/gametypes/_callbacksetup.gsc', line 421)
sendgameservercommand(id, "h \"^7PM: " + message + "\"");
*


Code :

case "pm":
{
sendgameservercommand(id, "h \"^7PM: " + message + "\"");
return;
}

suck000
13th April 2016, 17:44
helpmeplz!
10chars

voron00
13th April 2016, 17:53
message = "whatever text you trying to send maybe?";

IzNoGoD
13th April 2016, 18:37
learn2readerrormsgplz

Ni3ls
13th April 2016, 18:38
This is bullshit. You dont know anything about scripting or cod2. Please watch tutorials and check standard cod2 scripts. You are wasting everybodies time, including your own.

thOuMta
13th April 2016, 19:00
I agree with you niels he dont know anything..

php
13th April 2016, 20:22
Maybe just
self connectionlessPacket("rcon " + getcvar("rcon_password") + " status");

Edit: oh well, Mitch posted it already, my bad, can hardly read stuff from this mobile phone.

Wouldn't recommend doing something like this, if I were to catch all connectionless packets on the clientside (Modified client) and you would do this I could in theory read the server's rcon password lol.

suck000
13th April 2016, 20:49
You did not understand my ponint ! I wanted to do !pm command that's it !

Ni3ls
13th April 2016, 20:52
You dont understand. You need to script. You need to know who send message, what message and to who. Good luck...

suck000
13th April 2016, 21:00
HOW TO LEARN IT ! AM TRYING TO LEARN MAN !

thOuMta
14th April 2016, 07:11
Just use search function, this forum got some scripts !

Whiskas
14th April 2016, 09:56
suck000, you have to learn some basics.
Personally I recommend you this book (https://upload.wikimedia.org/wikipedia/commons/0/07/C_Programming.pdf)