Raised This Month: $ Target: $400
 0% 

[NeedHelp]GHW_cronic connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FRITT33
Junior Member
Join Date: Jun 2008
Old 08-29-2009 , 04:15   [NeedHelp]GHW_cronic connect
Reply With Quote #1

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
FRITT33 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-30-2009 , 08:49   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #2

Quote:
Originally Posted by FRITT33 View Post
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?
__________________
Bugsy is offline
FRITT33
Junior Member
Join Date: Jun 2008
Old 08-30-2009 , 16:07   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
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
FRITT33 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-30-2009 , 20:57   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #4

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
Mxnn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-30-2009 , 21:12   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #5

Quote:
Originally Posted by Mxnn View Post
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.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-30-2009 , 23:35   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #6

*[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 );

__________________

Last edited by Bugsy; 08-31-2009 at 09:22.
Bugsy is offline
FRITT33
Junior Member
Join Date: Jun 2008
Old 09-01-2009 , 12:16   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
*[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
FRITT33 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-02-2009 , 08:23   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #8

The connecting player will not see the message; only the other players that are currently on the server will.
__________________
Bugsy is offline
FRITT33
Junior Member
Join Date: Jun 2008
Old 09-03-2009 , 11:04   Re: [NeedHelp]GHW_cronic connect
Reply With Quote #9

OH ok ill use it and se what peapole think btw thanks for the good help !
Quote:
Originally Posted by Bugsy View Post
The connecting player will not see the message; only the other players that are currently on the server will.
FRITT33 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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