Raised This Month: $87 Target: $400
 21% 

[L4D2] Car Alarm Informer V2.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author
eyal282
Veteran Member
Join Date: Aug 2011
Plugin ID:
5998
Plugin Version:
2.0
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Informs all players who on earth is dumb enough to trigger the car alarm
    Old 01-20-2018 , 17:09   [L4D2] Car Alarm Informer V2.0
    Reply With Quote #1

    Report bugs please.

    No cvars or something.

    It'll print this when someone triggers the alarm, %s being the name, \x03 and the rest of the numbers representing colors.

    "\x03%s \x01has triggered the\x04 car alarm!\x01 I wanna see the\x05 hate!"
    Attached Files
    File Type: sp Get Plugin or Get Source (AlarmInformer_v2.sp - 994 views - 2.2 KB)
    __________________
    Accepting private work. Contact me if you're interested.
    If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

    Total Donated: 10$

    Last edited by eyal282; 01-21-2018 at 11:58.
    eyal282 is offline
    Emilio3
    Member
    Join Date: Aug 2013
    Location: London UK
    Old 01-22-2018 , 15:44   Re: [L4D2] Car Alarm Informer V2.0
    Reply With Quote #2

    https://forums.alliedmods.net/showthread.php?t=225388 is the some
    PHP Code:
    #define PLUGIN_VERSION "1.0"

    #pragma semicolon 1

    #include <sourcemod>

    public Plugin:myinfo =
    {
        
    name "[L4D2] Car Alarm Notify",
        
    author "raziEiL [disawar1]",
        
    description "",
        
    version PLUGIN_VERSION,
        
    url "http://steamcommunity.com/id/raziEiL"
    }

    static 
    g_iAlarmCarClient;

    public 
    OnPluginStart()
    {
        
    HookEvent("create_panic_event"event_PanicEvent);
        
    HookEvent("triggered_car_alarm"event_CarAlarmEventHookMode_PostNoCopy);
    }

    public 
    Action:event_PanicEvent(Handle:event, const String:name[], bool:dontBroadcast)
    {
        
    g_iAlarmCarClient GetClientOfUserId(GetEventInt(event"userid"));
        
    CreateTimer(0.5Clearg_iAlarmCarClient);
    }

    public 
    Action:Clear(Handle:timerg_iAlarmCarClient 0;

    public 
    Action:event_CarAlarm(Handle:event, const String:name[], bool:dontBroadcast)
    {
        if (
    g_iAlarmCarClient && IsClientInGame(g_iAlarmCarClient) && GetClientTeam(g_iAlarmCarClient) == 2){

            
    PrintToChatAll("Car Alarm Triggered by %N"g_iAlarmCarClient);
            
    g_iAlarmCarClient 0;
        }


    Last edited by Emilio3; 01-22-2018 at 15:46.
    Emilio3 is offline
    Crasher_3637
    AlliedModders Donor
    Join Date: May 2012
    Location: average villain lair
    Old 01-22-2018 , 19:12   Re: [L4D2] Car Alarm Informer V2.0
    Reply With Quote #3

    The plugin that you linked was disapproved because the author didn't even provide a plugin in that post...
    __________________
    AFK like JFK
    Crasher_3637 is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Brexit
    Old 01-22-2018 , 22:22   Re: [L4D2] Car Alarm Informer V2.0
    Reply With Quote #4

    Why not do a director hint, like it shows you in l4d1

    here is my stock for showing specific client a director hint.
    You should use it in a forloop.

    PHP Code:
    DirectorHint(iClient, const Float:fHintTime=5.0, const String:sHintIcon[]="icon_alert", const String:sHintCaption[]="Print to me baby", const String:sHintColour[]="100 100 100")
    {
        static 
    iEntity;
        
    iEntity CreateEntityByName("env_instructor_hint");
        if(
    iEntity 1)
            return;
        
        static 
    String:sValues[72];
        
    FormatEx(sValuessizeof(sValues), "hint%d"iClient);
        
    DispatchKeyValue(iClient"targetname"sValues);
        
    DispatchKeyValue(iEntity"hint_target"sValues);
        
        
    DispatchKeyValue(iEntity"hint_range""100");
        
    DispatchKeyValue(iEntity"hint_icon_onscreen"sHintIcon);
        
        
    FormatEx(sValuessizeof(sValues), "%f"fHintTime);
        
    DispatchKeyValue(iEntity"hint_timeout"sValues);
        
        
    FormatEx(sValuessizeof(sValues), "%s"sHintCaption);
        
    DispatchKeyValue(iEntity"hint_caption"sValues);
        
    DispatchKeyValue(iEntity"hint_color"sHintColour);
        
    DispatchSpawn(iEntity);
        
    AcceptEntityInput(iEntity"ShowHint"iClient);
        
        
    FormatEx(sValuessizeof(sValues), "OnUser1 !self:Kill::%f:1"fHintTime);
        
    SetVariantString(sValues);
        
    AcceptEntityInput(iEntity"AddOutput");
        
    AcceptEntityInput(iEntity"FireUser1");

    __________________
    Lux is offline
    eyal282
    Veteran Member
    Join Date: Aug 2011
    Old 01-23-2018 , 03:37   Re: [L4D2] Car Alarm Informer V2.0
    Reply With Quote #5

    Quote:
    Originally Posted by Emilio3 View Post
    https://forums.alliedmods.net/showthread.php?t=225388 is the some
    PHP Code:
    #define PLUGIN_VERSION "1.0"

    #pragma semicolon 1

    #include <sourcemod>

    public Plugin:myinfo =
    {
        
    name "[L4D2] Car Alarm Notify",
        
    author "raziEiL [disawar1]",
        
    description "",
        
    version PLUGIN_VERSION,
        
    url "http://steamcommunity.com/id/raziEiL"
    }

    static 
    g_iAlarmCarClient;

    public 
    OnPluginStart()
    {
        
    HookEvent("create_panic_event"event_PanicEvent);
        
    HookEvent("triggered_car_alarm"event_CarAlarmEventHookMode_PostNoCopy);
    }

    public 
    Action:event_PanicEvent(Handle:event, const String:name[], bool:dontBroadcast)
    {
        
    g_iAlarmCarClient GetClientOfUserId(GetEventInt(event"userid"));
        
    CreateTimer(0.5Clearg_iAlarmCarClient);
    }

    public 
    Action:Clear(Handle:timerg_iAlarmCarClient 0;

    public 
    Action:event_CarAlarm(Handle:event, const String:name[], bool:dontBroadcast)
    {
        if (
    g_iAlarmCarClient && IsClientInGame(g_iAlarmCarClient) && GetClientTeam(g_iAlarmCarClient) == 2){

            
    PrintToChatAll("Car Alarm Triggered by %N"g_iAlarmCarClient);
            
    g_iAlarmCarClient 0;
        }

    Mine looks a bit more efficient and if someone ever decides to go insane and allow 2 car alarms to trigger, no bugs will occur.
    __________________
    Accepting private work. Contact me if you're interested.
    If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

    Total Donated: 10$
    eyal282 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 06:37.


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