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

Solved GetClientIP not return client ip on local server l4d2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
greed35
New Member
Join Date: Aug 2018
Old 10-20-2020 , 16:42   GetClientIP not return client ip on local server l4d2
Reply With Quote #1

Hello that is my first time here my doubt is why my code not return name of country people connected on my local server in l4d2

my code is

Code:
#include <sourcemod>
#include <sdktools>
#include <geoip>


int  randomnum = 0;
float  count = 0;


public Action pingmask(Handle timer, any client)
{	
	count += 0.5;
	SetEntProp(GetPlayerResourceEntity(), Prop_Send, "m_iPing", randomnum,_,client);
	
	if(count > 300.0)
	{
		PrintToChatAll( "\x04Escreva \x03!sm \x04no chat para mutar ou desmutar um jogador escolhido");
		count = 0;
	}
	
	return Plugin_Continue;
}



public void OnClientPostAdminCheck(int client)
{
	
	char clientip[32],country[46],name[32],authid[35];
	
	if (!IsClientInGame(client)) 	return;
	
	GetClientAuthString(client,authid,34);
	GetClientName(client, name,31);
	PrintToChat(client, "\x04Escreva \x03!sm \x04no chat para mutar ou desmutar um jogador escolhido");
	
	
	if(CheckCommandAccess(client, "sm_ban", ADMFLAG_BAN))
		{
			randomnum = GetRandomInt(143, 175);
			CreateTimer(0.5, pingmask, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
			Format(clientip, sizeof(clientip), Steam_GetPublicIP());
			//PrintToChatAll("\x04%s",clientip);
			GeoipCountry(clientip, country, sizeof(country));
			
		}
	else
		{
			GetClientIP(client, clientip, sizeof(clientip));
			PrintToChatAll("\x03%s",clientip);
			GeoipCountry(clientip, country, sizeof(country));
		}
		
	if(!StrEqual(authid,"BOT"))
	PrintToChatAll("\x01\x04%s (\x01%s\x04) connected from \x03%s",name,authid,country);
}

Last edited by greed35; 10-20-2020 at 16:49.
greed35 is offline
Reply


Thread Tools
Display Modes

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 14:43.


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