AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   rcon (https://forums.alliedmods.net/showthread.php?t=27643)

kmal2t 04-26-2006 05:11

rcon
 
can amx use rcon fully? such as run any rcon command and possibly get rcon information. i.e if you ran a command like amx_rcon maps * could it get that information?

Also, there is a command to detect when someone joins. What is the command to detect if someone is downloading off of the server? client_download(id) or something?

kmal2t 04-26-2006 16:12

Anyone?

BadAim 04-26-2006 19:31

the only thing u can get is a plugin connect_anounce and it dont say if the guy is donwloading or not

kmal2t 04-26-2006 20:45

Ok so then you can detect when they connect.

Can you detect when they join the game?

KoST 04-26-2006 20:50

Code:

client_authorized - Called when a player has authenticated with Steam
client_command - Called when a client sends a command.
client_connect - Called when a client connects
client_disconnect - Called when a player disconnects
client_infochanged - Called when a user's client info struct is changed
client_putinserver - Called when a player is initialized into the game.

  • Quote:

    Originally Posted by kmal2t
    Ok so then you can detect when they connect.

  • public client_connect(id){}
  • Quote:

    Originally Posted by kmal2t
    Can you detect when they join the game?

  • public client_putinserver(id){}

kmal2t 04-26-2006 21:33

asdf

KoST 04-26-2006 21:45

ok, you can use get_gametime() function to store start_time in client_connect and end_time in client_putinserver, then calculate the difference..

Code:
#include <amxmodx> new Float:start_time[33] new Float:end_time[33] public plugin_init(){     register_plugin("ConnectTime","1.0","KoST") } public client_connect(id){     start_time[id]=get_gametime()     return PLUGIN_CONTINUE } public client_putinserver(id){     end_time[id]=get_gametime()         new Float:difference=end_time[id]-start_time[id]     if (difference>7.0){         //do kick here     }     return PLUGIN_CONTINUE }

but you can also disable download from server very easy:
set server-cvar 'sv_allowdownload 0'

kmal2t 04-26-2006 22:25

what do I replace //do kick here with to have it do amx_rcon kick "user" "message" ???

And out of curiosity why is it return PLUGIN_CONTINUE and not handled since once they join the game or are kicked the plugin has completed it's function?

KoST 04-26-2006 22:49

Code:
#include <amxmodx> new Float:start_time[33] new Float:end_time[33] public plugin_init(){     register_plugin("ConnectTime","1.0","KoST") } public client_connect(id){     start_time[id]=get_gametime()     return PLUGIN_CONTINUE } public client_putinserver(id){     end_time[id]=get_gametime()         new Float:difference=end_time[id]-start_time[id]     if (difference>7.0){         new userid=get_user_userid(id)           server_cmd("amx_kick #%d %s",userid,"Reason here")     }     return PLUGIN_CONTINUE }

im not quite sure if server_cmd is blocked when you put PLUGIN_HANDLED in client_putinserver, in client_connect you could use PLUGIN_HANDLED

[edit]
i use PLUGIN_HANDLED only if i want to block things.

kmal2t 04-26-2006 23:13

I think something is wrong in the kick function. I'm gonna see if I can fix it.


All times are GMT -4. The time now is 05:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.