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.