Raised This Month: $12 Target: $400
 3% 

Connect Disconnect Info


Post New Thread Reply   
 
Thread Tools Display Modes
missdivya
BANNED
Join Date: Nov 2009
Old 11-28-2009 , 23:40   Re: Connect Disconnect Info
Reply With Quote #11

wht is diff betwn client_connect(id) and client_putinserver( id)
missdivya is offline
missdivya
BANNED
Join Date: Nov 2009
Old 11-28-2009 , 23:42   Re: Connect Disconnect Info
Reply With Quote #12

also the code is Alucard^ is wrong or wht can i use it or not
missdivya is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-28-2009 , 23:51   Re: Connect Disconnect Info
Reply With Quote #13

Quote:
Originally Posted by missdivya View Post
wht is diff betwn client_connect(id) and client_putinserver( id)
The difference is the timing at which it is called. In this instance we need to get a users authid (it was used in original code) which is not available at client_connect(); steamid is available at client_authorized() which usually occurs between client_connect() and client_putinserver(). client_putinserver() is called last when the player is fully initialized into game. If you eliminate getting the authid you could probably get away with using client_connect instead but there's no advantage besides seeing the client_print a fraction of a second earlier when the player connects.

Quote:
Originally Posted by missdivya View Post
also the code is Alucard^ is wrong or wht can i use it or not
The code is usable but it needs the arrays turned into 2-dimension arrays. Why not use the code I posted above? It is ready to compile and run.
__________________
Bugsy is offline
missdivya
BANNED
Join Date: Nov 2009
Old 11-28-2009 , 23:55   Re: Connect Disconnect Info
Reply With Quote #14

yeah bugsy thank i m using ur code only in my server now THANKS +k and also if possible can u edit alucard code so that i can try it
missdivya is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-28-2009 , 23:58   Re: Connect Disconnect Info
Reply With Quote #15

Sure, here's alucards code (untested)
PHP Code:
#include <amxmodx>
#include <geoip>

#define PLUGIN    "Connect & Disconnect Messages"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

new Name[33][32], IP[33][24], Country[33][45]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id)
{
    
get_user_nameid Name[id] , 31 )
    
get_user_ipid IP[id] , 23 )
    
geoip_countryIP[id] , Country[id] , 44 )
    
    
client_print(0print_chat"%s connect from %s (IP: %s)"Name[id] , Country[id] , IP[id] )
}

public 
client_disconnect(id)
{
    
client_print(0print_chat"%s disconnect from %s (IP: %s)"Name[id] , Country[id] , IP[id] )

__________________
Bugsy is offline
missdivya
BANNED
Join Date: Nov 2009
Old 11-28-2009 , 23:59   Re: Connect Disconnect Info
Reply With Quote #16

oh really thanks bugsy but than also i m using ur code
missdivya is offline
missdivya
BANNED
Join Date: Nov 2009
Old 11-29-2009 , 00:00   Re: Connect Disconnect Info
Reply With Quote #17

PData[ id ][ szName ][ 0 ] = EOS;
PData[ id ][ szIP ][ 0 ] = EOS;
PData[ id ][ szCountry ][ 0 ] = EOS;

so this is not required in alucard's code
missdivya is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-29-2009 , 00:35   Re: Connect Disconnect Info
Reply With Quote #18

Quote:
Originally Posted by missdivya View Post
PData[ id ][ szName ][ 0 ] = EOS;
PData[ id ][ szIP ][ 0 ] = EOS;
PData[ id ][ szCountry ][ 0 ] = EOS;

so this is not required in alucard's code
That has nothing to do with that code.
__________________
fysiks is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 11-29-2009 , 00:44   Re: Connect Disconnect Info
Reply With Quote #19

why don't just use ghw plugin?
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-29-2009 , 09:15   Re: Connect Disconnect Info
Reply With Quote #20

Below is for Alucards code. It technically isn't needed in either code because the strings are updated with new data when a new player connects. The below code is just clearing the string variables when a player disconnects.

PHP Code:
Name[id][0] = EOS;
IP[id][0] = EOS;
Country[id][0] = EOS
__________________

Last edited by Bugsy; 11-29-2009 at 09:26.
Bugsy 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 22:41.


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