Raised This Month: $ Target: $400
 0% 

Solved [L4D2] Beginning of Game Message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
leaffan
Senior Member
Join Date: Jan 2013
Old 05-26-2023 , 09:49   Re: [L4D2] Beginning of Game Message
Reply With Quote #5

Quote:
Originally Posted by alasfourom View Post
PHP Code:
#include <sourcemod>
#include <left4dhooks>

#pragma semicolon 1
#pragma newdecls required

bool g_bLeftSafeArea;
Handle g_hTimerMessage[MAXPLAYERS+1];

public 
Plugin myinfo =
{
    
name        "[L4D2] Game Start Message",
    
author      "Drixevel",
    
description "Prints a message in chat when the game starts.",
    
version     "1.0.0",
    
url         "https://drixevel.dev/"
};

public 
void OnPluginStart()
{
    
HookEvent("round_freeze_end"Event_RoundFreezeEndEventHookMode_PostNoCopy);
}

public 
void OnMapStart()
{
    
g_bLeftSafeArea false;
}

public 
void OnClientPutInServer(int client)
{
    if(!
IsFakeClient(client) && !g_bLeftSafeArea)
        
g_hTimerMessage[client] = CreateTimer(5.0Timer_DisplayMessageInSafeAreaGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}

void Event_RoundFreezeEnd(Event event, const char[] namebool dontBroadcast)
{
    
g_bLeftSafeArea false;
    for(
int i 1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i) || IsFakeClient(i) || g_hTimerMessage[i] != null) continue;
        
g_hTimerMessage[i] = CreateTimer(5.0Timer_DisplayMessageInSafeAreaGetClientUserId(i), TIMER_FLAG_NO_MAPCHANGE);
    }
}

Action Timer_DisplayMessageInSafeArea(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    if (
client == || !IsClientInGame(client)) return Plugin_Handled;
    
    if(!
g_bLeftSafeAreaPrintToChat(client"\x04Inside Safe Area Message");
    
g_hTimerMessage[client] = null;
    return 
Plugin_Handled;
}

public 
void L4D_OnFirstSurvivorLeftSafeArea_Post(int client)
{
    
g_bLeftSafeArea true;
    
PrintToChatAll("\x04[Oyun Mod-Kontrolü] \x01Oyun başladı. Oyun Mod'u hazır! Bol şanslar! İyi oyunlar...");

Thank you very much. It works perfectly. Thanks.
leaffan is offline
 


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 23:10.


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