Jump to content
assignment_ind Existing user? Sign In

Sign In



person_add Sign Up
Go-Code.pl - Support SourceMod i Pluginy CS:GO
Sign in to follow this  
Headshotplay

[Rozwiązane] Prośba o aktualizację pluginu

Recommended Posts

Witam,

Czy mógłby ktoś aktualizować ten plugin ?

 

Cytat

L 03/21/2019 - 19:41:27: [SM] Exception reported: Could not send a usermessage L 03/21/2019 - 19:41:27: [SM] Blaming: connectmessage (1).smx L 03/21/2019 - 19:41:27: [SM] Call stack

trace: L 03/21/2019 - 19:41:27: [SM] [0] PrintToChat L 03/21/2019 - 19:41:27: [SM] [1] Line 386, C:\Users\dell\Desktop\scripting\include\halflife.inc::PrintToChatAll L 03/21/2019 - 19:41:27: [SM] [2] Line 68, C:\Users\dell\Desktop\scripting\connectmessage (1).sp::OnClientDisconnect

 

kod:
 

Cytat

#include <sourcemod>
#include <geoip>
#pragma tabsize 0

new Handle:h_connectmsg = INVALID_HANDLE;
new Handle:h_disconnectmsg = INVALID_HANDLE;

public Plugin:myinfo = 
{
    name = "Connect MSG",
    author = "Crazy",
    description = "Provides Info of the player when he joins",
    version = "1.0",
    url = ""
};

public OnPluginStart()
{    
    h_connectmsg = CreateConVar("sm_connectmsg", "1", "Shows a connect message in the chat once a player joins.", FCVAR_NOTIFY | FCVAR_DONTRECORD);
    h_disconnectmsg = CreateConVar("sm_disconnectmsg", "1", "Shows a disconnect message in the chat once a player leaves.", FCVAR_NOTIFY | FCVAR_DONTRECORD);
}

public OnClientPutInServer(client)
{
    new Connect = GetConVarInt(h_connectmsg);
    if(Connect == 1)
    {
        new String:name[99], String:authid[99], String:IP[99], String:Country[99];
        
        GetClientName(client, name, sizeof(name));
        
        GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
        
        GetClientIP(client, IP, sizeof(IP), true);
        
    if(!GeoipCountry(IP, Country, sizeof Country))
    {
        Country = "Unknown Country";
    }  
        PrintToChatAll(" \x04[CONNECT]\x03 %s (%s) dołączył na serwer z [%s]", name, authid, Country);
        
    } else {
  
    CloseHandle(h_connectmsg);
   }
}

public OnClientDisconnect(client)
{
    new Disconnect = GetConVarInt(h_disconnectmsg);
    if(Disconnect == 1)
    
    {
        new String:name[99], String:authid[99], String:IP[99], String:Country[99];
        
        GetClientName(client, name, sizeof(name));
        
        GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
        
        GetClientIP(client, IP, sizeof(IP), true);
        
    if(!GeoipCountry(IP, Country, sizeof Country))
    
    {
        Country = "Unknown Country";
    }
    
        PrintToChatAll(" \x04[DISCONNECT]\x03 %s (%s) wyszedł z serwera z [%s]", name, authid, Country);
        
    } else {
    
    CloseHandle(h_disconnectmsg);
}

}

 

Cytat

Stack Trace

Function

0sourcemod.2.csgo.so!UTIL_SendHudText [cstrike15_usermessages.pb.h:7770 + 0x0] 

1sourcemod.2.csgo.so!ShowHudText [smn_hudtext.cpp:490 + 0x14] 

 

Edited by Headshotplay

Share this post


Link to post
Share on other sites
Spoiler

#include <sourcemod>
#include <geoip>
#include <multicolors>
#pragma tabsize 0

#pragma newdecls required
#pragma semicolon 1

Handle h_connectmsg = INVALID_HANDLE;
Handle h_disconnectmsg = INVALID_HANDLE;

public Plugin myinfo = 
{
	name = "Connect MSG",
	author = "Crazy",
	description = "Provides Info of the player when he joins",
	version = "1.0",
	url = ""
};

public void OnPluginStart()
{	
	h_connectmsg = CreateConVar("sm_connectmsg", "1", "Shows a connect message in the chat once a player joins.", FCVAR_NOTIFY | FCVAR_DONTRECORD);
	h_disconnectmsg = CreateConVar("sm_disconnectmsg", "1", "Shows a disconnect message in the chat once a player leaves.", FCVAR_NOTIFY | FCVAR_DONTRECORD);
}

public void OnClientPutInServer(int client)
{
	int Connect = GetConVarInt(h_connectmsg);
	if(Connect == 1)
	{
	
	char name[99];
	char authid[99];
	char IP[99];
	char Country[99];
		
	GetClientName(client, name, sizeof(name));
	GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
	GetClientIP(client, IP, sizeof(IP), true);
		
	if(!GeoipCountry(IP, Country, sizeof Country))
	{
		Country = "Nieznany kraj";
	}  
	
		CPrintToChatAll("{lightred}%s (%s) {yellow}dołączył do serwera z {lightred}[%s]", name, authid, Country); 
		
	} else {
	
		CloseHandle(h_connectmsg);
	}
}

public void OnClientDisconnect(int client)
{
	int Disconnect = GetConVarInt(h_disconnectmsg);
	if(Disconnect == 1)
	{
	
	char name[99];
	char authid[99];
	char IP[99];
	char Country[99];
		
	GetClientName(client, name, sizeof(name));
	GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
	GetClientIP(client, IP, sizeof(IP), true);
		
	if(!GeoipCountry(IP, Country, sizeof Country))
	{
        Country = "Nieznany kraj";
	}
	
		CPrintToChatAll("{lightred} %s (%s) {yellow}opuścił serwer z {lightred}[%s]", name, authid, Country);
		
    } else {
	
		CloseHandle(h_disconnectmsg);
	}
}

 

?

Share this post


Link to post
Share on other sites

Tak, dzięki 

Share this post


Link to post
Share on other sites

Wiadomość wygenerowana automatycznie

 

Pomoc udzielona

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.


O NAS Jesteśmy społecznością łączącą ludzi, którzy dzielą pasję poznawania CS:GO od strony programistycznej. Posiadamy duże zaplecze merytoryczne i zawsze cieszymy się, gdy dołączają do nas osoby gotowe do nauki. Gwarantujemy, że z odrobiną wytrwałości i otwartym umysłem bardzo szybko napiszesz swój pierwszy plugin. Zapraszamy! 🙂
Szablon wykonany z dużą ilością przez cyberpixelz / Mesharsky / Sitefuture
Forum dumnie napędzane przez: Invision Power Services, Inc.
×
×
  • Create New...