Raised This Month: $ Target: $400
 0% 

Add country to connect message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Nocky
Member
Join Date: Oct 2013
Location: Czech Republic
Old 11-08-2019 , 12:35   Add country to connect message
Reply With Quote #1

Hello guys, pleases i need help with add Country to connect message.

Code:
public Action:ev_PlayerConnect(Handle:event, const String:name[], bool:dontBroadcast)
{
	if (GetConVarBool(cvarBlockConnectMessage))
	{
		if (!dontBroadcast)
		{
			new iUserId = GetEventInt(event, "userid");
			new iClient = GetClientOfUserId(iUserId);
        	        new String:String:IP[99], String:Country[99];   // this is line 124
			
			if(!GeoipCountry(IP, Country, sizeof Country))
			{
        		Country = "Unknown Country";
    		        }  
        
			decl String:strNetworkId[50];
			GetEventString(event, "networkid", strNetworkId, sizeof(strNetworkId));
			decl String:strAddress[50];
			GetEventString(event, "address", strAddress, sizeof(strAddress));
			
			if (iClient != 0)
			{
				if (GetConVarInt(cvarAdminShowMessages) == 1)
				{
					for (new i = 1; i <= MaxClients; i++)
					{
						if (IsClientConnected(i) && IsClientInGame(i) && GetUserAdmin(i) != INVALID_ADMIN_ID)
						{
							PrintToChat(i,"%N has connected. (%s)", iClient, Country);
						}
					}
				}
			}
			
			SetEventBroadcast(event, true);
		}
	}
	return Plugin_Continue;
}

Error:
Code:
plugin.sp(124) : warning 217: loose indentation
plugin.sp(124) : error 001: expected token: "-identifier-", but found "-label-"
plugin.sp(124) : error 017: undefined symbol "IP"
plugin.sp(124) : warning 215: expression has no effect
plugin.sp(124) : error 001: expected token: ";", but found "]"
plugin.sp(124) : fatal error 190: too many error messages on one line

Last edited by Nocky; 11-08-2019 at 12:36.
Nocky is offline
 



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 19:11.


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