AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [NeedHelp]GHW_cronic connect (https://forums.alliedmods.net/showthread.php?t=101975)

FRITT33 08-29-2009 04:15

[NeedHelp]GHW_cronic connect
 
Hi i need help with this Plugin
The thing is that i want to add so i can se how manny connections totaly on the server so it counts the connections it shold look like this


*[AMXX] FriTTe has connected from Sweden. [Connections: 1]*

if u understand pleas help me code it in or do it for me :)
BTW: i suck at eng

Bugsy 08-30-2009 08:49

Re: [NeedHelp]GHW_cronic connect
 
Quote:

Originally Posted by FRITT33 (Post 916361)
Hi i need help with this Plugin
The thing is that i want to add so i can se how manny connections totaly on the server so it counts the connections it shold look like this


*[AMXX] FriTTe has connected from Sweden. [Connections: 1]*

if u understand pleas help me code it in or do it for me :)
BTW: i suck at eng

Do you want it to show the # of people currently connected when that user connects? Or the order at which that player has connected since the last mapchange?

FRITT33 08-30-2009 16:07

Re: [NeedHelp]GHW_cronic connect
 
Quote:

Originally Posted by Bugsy (Post 917811)
Do you want it to show the # of people currently connected when that user connects? Or the order at which that player has connected since the last mapchange?

i want to see the total connection of peapole so it counts like if i got 5 peapole that has connected to the server or if i have 10000000 players tha has connected just so it counts connections all the time as long as the servers on if u understand :P

Mxnn 08-30-2009 20:57

Re: [NeedHelp]GHW_cronic connect
 
But the plugin will create much vars.
Because i join the server with the name "hey!" (the plugin will create a new counter that names "hey!" and the value 1, because is the first connection)
Then i join the server with the name "hey" and is another counter.. :S

fysiks 08-30-2009 21:12

Re: [NeedHelp]GHW_cronic connect
 
Quote:

Originally Posted by Mxnn (Post 918460)
But the plugin will create much vars.
Because i join the server with the name "hey!" (the plugin will create a new counter that names "hey!" and the value 1, because is the first connection)
Then i join the server with the name "hey" and is another counter.. :S

That's what he asked for. It will increment the counter on every connection.

Bugsy 08-30-2009 23:35

Re: [NeedHelp]GHW_cronic connect
 
*[AMXX] FriTTe has connected from Sweden. [Connections: 1]*

Edit: I reviewed your original post and it looks like you may want the # of times each player has been to the server. Is this true? I can edit the code for this if yes. Or perhaps this code is correct but you want the players name added to the chat print.

Not sure if this is what you're looking for. You did not specify when\if you want the count to reset so this will continue to count even if the server is shutdown\restarted.

PHP Code:

#include <amxmodx>
#include <nvault>

#define VAULT_NAME    "CONNECTIONS"
#define VAULT_KEY    "NUM"
new g_iVault;

public 
plugin_init() 
{
    
register_plugin"Connection Counter" "1.0" "bugsy" );
    
    
g_iVault nvault_openVAULT_NAME );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_connectid )
{
    static 
szNum]; 
    
num_to_strnvault_getg_iVault VAULT_KEY ) + szNum );
    
nvault_setg_iVault VAULT_KEY szNum );
    
    
client_printprint_chat "* Player # %s as just connected to the server." szNum );



FRITT33 09-01-2009 12:16

Re: [NeedHelp]GHW_cronic connect
 
Quote:

Originally Posted by Bugsy (Post 918570)
*[AMXX] FriTTe has connected from Sweden. [Connections: 1]*

Edit: I reviewed your original post and it looks like you may want the # of times each player has been to the server. Is this true? I can edit the code for this if yes. Or perhaps this code is correct but you want the players name added to the chat print.

Not sure if this is what you're looking for. You did not specify when\if you want the count to reset so this will continue to count even if the server is shutdown\restarted.

PHP Code:

#include <amxmodx>
#include <nvault>

#define VAULT_NAME    "CONNECTIONS"
#define VAULT_KEY    "NUM"
new g_iVault;

public 
plugin_init() 
{
    
register_plugin"Connection Counter" "1.0" "bugsy" );
    
    
g_iVault nvault_openVAULT_NAME );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_connectid )
{
    static 
szNum]; 
    
num_to_strnvault_getg_iVault VAULT_KEY ) + szNum );
    
nvault_setg_iVault VAULT_KEY szNum );
    
    
client_printprint_chat "* Player # %s as just connected to the server." szNum );



i dont think it works i dont get anny message where it stands the connections or a connect message

Bugsy 09-02-2009 08:23

Re: [NeedHelp]GHW_cronic connect
 
The connecting player will not see the message; only the other players that are currently on the server will.

FRITT33 09-03-2009 11:04

Re: [NeedHelp]GHW_cronic connect
 
OH :D ok ill use it and se what peapole think :) btw thanks for the good help !
Quote:

Originally Posted by Bugsy (Post 920732)
The connecting player will not see the message; only the other players that are currently on the server will.



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

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