Jump to content

Home

Kick-reasons


Blµb

Recommended Posts

I've used the search for "kick reason" and haven't found this here, so thought about posting it :)

Something which came to my mind was to make the kick command add a reason to the kick, i thought about how to do this - because i always used trap_SendConsoleCommand(EXEC_INSERT, va("clientkick \"%i\"", cNum)); - and when i remembered that there's g_inactivity in the lib code not in the source code, i looked at it and found this:

void trap_DropClient( int clientNum, const char *reason );

so you can make things like /kick Blah "Stupid name :P"

result in trap_DropClient(5, "Stupid name :P"); =)

also haven't found kickreasons in other mods yet :)

Another reason to post it :D

Link to comment
Share on other sites

	//[test]
	//hmmm, this method seems to be breaking stuff.  doublechecking.
	//bots that left disconnect instead of being kicked.  I think it's scaring
	//players
	//trap_DropClient( cl->ps.clientNum, va(S_COLOR_WHITE "%s\n", G_GetStringEdString("MP_SVGAME", "DISCONNECTED")) );
	//[/test]
	trap_SendConsoleCommand( EXEC_INSERT, va("kick \"%s\"\n", netname) );

Link to comment
Share on other sites

the trap_DropClient method seems to cause a memory leak with bots. I'm not sure why. The defualt method seems to work, but it involves the kick message. Maybe there's something in the kickclient function for the bots specifically. What's the function name for that?

Link to comment
Share on other sites

i dunno...

 

u got the text from the crash (debug info?) or is it an error showing up in the jka console window after the game has crashed?

 

if not well just use:

 

trap_SendConsoleCommand( EXEC_INSERT, va("clientkick \"%d\"\n", cl->ps.clientNum));

 

like stated in the bugs thread, and remove the netname char and remove the cleanstr definition from that function.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...