Raised This Month: $ Target: $400
 0% 

[L4D1 AND L4D2] Cannounce Player Info


Post New Thread Reply   
 
Thread Tools Display Modes
Gento_aki
Junior Member
Join Date: Apr 2023
Location: warga Bogor
Old 11-15-2024 , 08:14   Re: [L4D1 AND L4D2] Cannounce Player Info
Reply With Quote #11

Quote:
Originally Posted by Slaven555 View Post
try:

#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <geoip>

#pragma newdecls required

public void OnPluginStart()
{
HookEvent("player_disconnect", event_PlayerDisconnect, EventHookMode_Pre);
}

public void OnClientPutInServer(int client)
{
if (!IsFakeClient(client))
{
char IP[99], Country[99];

GetClientIP(client, IP, sizeof(IP), true);

if (!GeoipCountry(IP, Country, sizeof Country))
{
Country = "Unknown Region";
}
if (CheckCommandAccess(client, "sm_admin", ADMFLAG_GENERIC, true))
return;

PrintToChatAll("\x01Player: \x04%N \x01connected from (\x03%s\x01)", client, Country);
}
}

public Action event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));

if (client && !IsFakeClient(client))
{
char reason[70];
event.GetString("reason", reason, sizeof(reason));

{
PrintToChatAll("\x01Player: \x04%N \x01-> \x05%s", client, reason);
}
}
return Plugin_Stop;
}
huge thanks Slaven555, this works
Gento_aki 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 17:39.


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