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

[CSGO] End of game message / popup


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DabberDoug
Member
Join Date: Feb 2016
Location: USA
Old 03-10-2019 , 01:08   [CSGO] End of game message / popup
Reply With Quote #1

I run a popular PUG / 10 man community in NA, I am looking for a popup message when the game ends to notify people to go to our website to look at the stats and points they received from the last match
DabberDoug is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 03-10-2019 , 03:11   Re: [CSGO] End of game message / popup
Reply With Quote #2

Untested
PHP Code:
ConVar g_hCVWebsite;

public 
void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_MatchEnd)
    
g_hCVWebsite CreateConVar("sm_website_url""www.example.com""Website to link to at match end.");
}

public 
void Event_MatchEnd(Event event, const char[] namebool dontBroadcast)
{
    
char sWebsite[64];
    
g_hCVWebsite.GetString(sWebsitesizeof(sWebsite));
    for(
int i 1<= MaxClientsi++) if(IsValidClient(i)) PrintToChat(i"Check out our website: %s to view the match stats."sWebsite);
}

stock bool IsValidClient(int client)
{
    if (
client >= && 
    
client <= MaxClients && 
    
IsClientInGame(client) &&
    !
IsFakeClient(client))
        return 
true;
    return 
false;

CliptonHeist is offline
NewDev
New Member
Join Date: Mar 2019
Old 03-12-2019 , 07:59   Re: [CSGO] End of game message / popup
Reply With Quote #3

Quote:
Originally Posted by CliptonHeist View Post
Untested
PHP Code:
ConVar g_hCVWebsite;

public 
void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_MatchEnd)
    
g_hCVWebsite CreateConVar("sm_website_url""www.example.com""Website to link to at match end.");
}

public 
void Event_MatchEnd(Event event, const char[] namebool dontBroadcast)
{
    
char sWebsite[64];
    
g_hCVWebsite.GetString(sWebsitesizeof(sWebsite));
    for(
int i 1<= MaxClientsi++) if(IsValidClient(i)) PrintToChat(i"Check out our website: %s to view the match stats."sWebsite);
}

stock bool IsValidClient(int client)
{
    if (
client >= && 
    
client <= MaxClients && 
    
IsClientInGame(client) &&
    !
IsFakeClient(client))
        return 
true;
    return 
false;



You can just do like that..
PHP Code:
ConVar g_hCVWebsite;

public 
void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_MatchEnd)
    
g_hCVWebsite CreateConVar("sm_website_url""www.example.com""Website to link to at match end.");
}

public 
void Event_MatchEnd(Event event, const char[] namebool dontBroadcast)
{
    
char sWebsite[64];
    
g_hCVWebsite.GetString(sWebsitesizeof(sWebsite));
    for(
int i 1<= MaxClientsi++)
    
PrintToChatAll("Check out our website: %s to view the match stats."sWebsite);

NewDev is offline
DabberDoug
Member
Join Date: Feb 2016
Location: USA
Old 03-12-2019 , 10:06   Re: [CSGO] End of game message / popup
Reply With Quote #4

Thank you to both of you. This isn’t necessarily what I was looking for, for example on some servers you type in SM plugins in console and a picture of a scary face and a scream audio happen before you get kicked, I don’t want scream audio but if it pops up a full screen picture that I can make that is just a promo to take them to the site and kicks them from the pug I’ll pay
DabberDoug is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 03-12-2019 , 14:20   Re: [CSGO] End of game message / popup
Reply With Quote #5

I can do this when I get home if someone doesn't do it before me
CliptonHeist is offline
DabberDoug
Member
Join Date: Feb 2016
Location: USA
Old 03-12-2019 , 20:32   Re: [CSGO] End of game message / popup
Reply With Quote #6

Quote:
Originally Posted by CliptonHeist View Post
I can do this when I get home if someone doesn't do it before me
Thanks Friend!
DabberDoug is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 03-12-2019 , 20:58   Re: [CSGO] End of game message / popup
Reply With Quote #7

Quote:
Originally Posted by NewDev View Post
You can just do like that..
PHP Code:
ConVar g_hCVWebsite;

public 
void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_MatchEnd)
    
g_hCVWebsite CreateConVar("sm_website_url""www.example.com""Website to link to at match end.");
}

public 
void Event_MatchEnd(Event event, const char[] namebool dontBroadcast)
{
    
char sWebsite[64];
    
g_hCVWebsite.GetString(sWebsitesizeof(sWebsite));
    for(
int i 1<= MaxClientsi++)
    
PrintToChatAll("Check out our website: %s to view the match stats."sWebsite);

You made it worse by having it print multiple times for every client on the server... to every client on the server.

Code:
public void Event_MatchEnd(Event event, const char[] name, bool dontBroadcast)
{
	char sWebsite[64];
	g_hCVWebsite.GetString(sWebsite, sizeof(sWebsite));
	PrintToChatAll("Check out our website: %s to view the match stats.", sWebsite);
}

Last edited by Drixevel; 03-12-2019 at 20:59.
Drixevel is offline
Reply



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


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