Raised This Month: $ Target: $400
 0% 

[CSGO]Need help with player connect message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VJScope
Senior Member
Join Date: Jul 2012
Location: Finland
Old 01-28-2016 , 07:14   [CSGO]Need help with player connect message
Reply With Quote #1

Hello!

I'm trying to modify player connect message plugin in such a way that it checks a player who joined, saves his steamid or IP or other information. Then the plugin checks the information of the next player who connects and compares his information to the previous person. If the information is same, the plugin won't announce that the player has connected. I do this because an update broke something in the game so banned or country filter restricted players get stuck in connection loop and fill the chat with connection messages. I have tried for hours but can't figure out what I'm doing wrong.

What I have done
Code:
#include <sourcemod>
#include <geoip>

#define MAX_ID			32
#define MAX_NAME		96
#define MAX_BUFF_SM		128

public OnClientAuthorized(client,const String:auth[])
{
	if (IsFakeClient(client)){
		return;
	}
	
	decl String:ip[MAX_ID],String:name[MAX_NAME],String:country[MAX_NAME],String:from[MAX_BUFF_SM];
	GetClientName(client,name,sizeof(name));
	if (GetClientIP(client,ip,sizeof(ip)) && GeoipCountry(ip,country,sizeof(country)))
		Format(from,sizeof(from)," from \x03%s",country);
	else from = "";
	
	PrintToChatAll("\x04%s [\x03%s\x04] connected%s",name,auth,from);
}
I tried to declare another string called ip2 and simply ip = ip2 but it either doesn't give any value to ip2 when trying to printtochat or it gives DEFGHIJKLMNOPQRS9 chars before the ip. I'm completely lost even though I'm sure that this is supposed to be basic stuff...
__________________
Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony.

Last edited by VJScope; 01-28-2016 at 07:23.
VJScope is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-28-2016 , 07:56   Re: [CSGO]Need help with player connect message
Reply With Quote #2

Update to a newer SourceMod version and you won't have the connection loop issue. This was fixed over a month and a half ago, very shortly after the game update that broke it.

Last edited by psychonic; 01-28-2016 at 07:56.
psychonic is offline
VJScope
Senior Member
Join Date: Jul 2012
Location: Finland
Old 01-28-2016 , 08:22   Re: [CSGO]Need help with player connect message
Reply With Quote #3

Quote:
Originally Posted by psychonic View Post
Update to a newer SourceMod version and you won't have the connection loop issue. This was fixed over a month and a half ago, very shortly after the game update that broke it.
Hmm.. I remember trying newer SM and it either didn't fix it or it broke something else. Maybe I'm remembering wrong so I'll try again. But I really would like to know how to do this just out of curiousity. So if someone can help me out, great!
__________________
Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony.
VJScope 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 10:08.


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