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

Solved l4d2 safe door print


Post New Thread Reply   
 
Thread Tools Display Modes
Neon123
Senior Member
Join Date: Jan 2016
Old 11-07-2017 , 14:12   Re: [req] l4d2 safe door print
Reply With Quote #11

PHP Code:
#pragma semicolon 1
#include <sdktools>
#include <sourcemod>

public OnPluginStart()
{
    
HookEvent("door_open",Event_OpenDoor); 
    
HookEvent("door_close",Event_CloseDoor);
}

public 
Action:Event_OpenDoor(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
bool:safe GetEventBool(event"checkpoint");

    if(
safe)
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));
        if(
client != 0)
        {
            
PrintToChatAll("\x04 %N HAS OPEN THE SAFE DOOR"client);
            
LogMessage("%N HAS OPEN THE SAFE DOOR"client);
        }
    }
}

public 
Action:Event_CloseDoor(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
bool:safe GetEventBool(event"checkpoint");

    if(
safe)
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));
        if(
client != 0)
        {
            
PrintToChatAll("\x04 %N HAS CLOSED THE SAFE DOOR"client);
            
LogMessage("%N HAS CLOSED THE SAFE DOOR"client);
        }
    }

thanks to manhkst and nico-op
Neon123 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 23:51.


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