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

[NMRiH] Simple Death Announcement


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Arcaster
Junior Member
Join Date: Nov 2013
Plugin ID:
3958
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Announces the name of players when they die.
    Old 11-03-2013 , 01:00   [NMRiH] Simple Death Announcement
    Reply With Quote #1

    This is my very first plugin and is tested to be working with version 1.07.1 of NMRiH. The game doesn't announce when players die (unless killed by another player), so I designed this plugin to provide a simple chat message to let other players know when someone is killed by a zombie or other source.
    Attached Files
    File Type: sp Get Plugin or Get Source (Death Announce.sp - 1899 views - 672 Bytes)

    Last edited by Arcaster; 11-03-2013 at 17:05.
    Arcaster is offline
    Altayir
    Junior Member
    Join Date: Oct 2013
    Location: France
    Old 11-03-2013 , 07:47   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #2

    Hello,

    Where is a .sp ?

    Bye.
    Altayir is offline
    Arcaster
    Junior Member
    Join Date: Nov 2013
    Old 11-03-2013 , 15:53   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #3

    Actually, the code I have is much shorter and simpler than that. Here it is:

    PHP Code:
    #include <sourcemod>

    public Plugin:myinfo =
    {
        
    name "Death Announce",
        
    author "Arcaster",
        
    description "Announces the death of players.",
        
    version "1.0",
        
    url ""
        
    };
        
    forward OnPluginStart();

    public 
    OnPluginStart()
    {
        
    PrintToServer("Death Announce by Arcaster has been loaded.");
        
    HookEvent("player_death"Event_PlayerDeath);
    }

    public 
    Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
    {
        
    decl String:name[64]
        new 
    victim_id GetEventInt(event"userid")
        new 
    victim GetClientOfUserId(victim_id)
        
    GetClientName(victimnamesizeof(name))
        
        
    PrintToChatAll("Player \"%s\" has been killed.",
        
    name);

    Arcaster is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 11-03-2013 , 16:42   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #4

    Please attach the source sp file to the first post. It will automatically generate an smx link without the need to attach it directly.
    psychonic is offline
    Arcaster
    Junior Member
    Join Date: Nov 2013
    Old 11-03-2013 , 17:05   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #5

    Quote:
    Originally Posted by psychonic View Post
    Please attach the source sp file to the first post. It will automatically generate an smx link without the need to attach it directly.
    Fixed.
    Arcaster is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 11-03-2013 , 17:09   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #6

    Quote:
    Originally Posted by Arcaster View Post
    Fixed.
    Thanks
    psychonic is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 11-04-2013 , 07:21   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #7

    FYI, you don't need to use GetClientName to print a client's name.

    PHP Code:
    public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new 
    victim_id GetEventInt(event"userid")
        new 
    victim GetClientOfUserId(victim_id)
        
        
    PrintToChatAll("Player \"%N\" has been killed.",
        
    victim);

    Does the same as your original code and is a bit shorter.
    __________________
    Dr. McKay is offline
    zerosignal
    New Member
    Join Date: Jun 2014
    Old 07-04-2014 , 12:37   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #8

    How to print a clean nick without the double quotes """" ?
    zerosignal is offline
    wrox
    Member
    Join Date: Nov 2009
    Location: /root
    Old 08-07-2014 , 08:46   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #9

    Quote:
    Originally Posted by zerosignal View Post
    How to print a clean nick without the double quotes """" ?
    Remove the escaped quotes by removing \".

    Before:
    Code:
        PrintToChatAll("Player \"%N\" has been killed.",
    After:
    Code:
        PrintToChatAll("Player %N has been killed.",
    Hope that helped you!
    __________________

    wrox is offline
    Nortank12
    New Member
    Join Date: Jun 2016
    Old 06-17-2016 , 11:36   Re: [NMRiH] Simple Death Announcement
    Reply With Quote #10

    How do I compile the sp?
    The compiler.exe says 2 errors
    Same with the other mods
    Can somebody help?
    Attached Thumbnails
    Click image for larger version

Name:	error.PNG
Views:	285
Size:	19.4 KB
ID:	155540  
    Nortank12 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 13:27.


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