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

[L4d2] Request - Simple Plugin (ad when you incapacitate someone)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VladimirTk
Senior Member
Join Date: Apr 2021
Location: Perú - Latino América
Old 07-29-2021 , 11:23   [L4d2] Request - Simple Plugin (ad when you incapacitate someone)
Reply With Quote #1

.I asked if someone can make this little chat announcement, I have searched and tested every plugin related to this but none announce when an infected or human incapacitates their rival or partner
.It is not necessary to do translations (I will) so that I only announce it in the chat is fine
CPrintToChatAll
► Mateo has incapacitated Lucas

Last edited by VladimirTk; 07-29-2021 at 11:58.
VladimirTk is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-29-2021 , 16:29   Re: [L4d2] Request - Simple Plugin (ad when you incapacitate someone)
Reply With Quote #2

player_incapacitated
  • userid - person who became incapacitated
  • attacker - user ID who made us incapacitated

PHP Code:
public void OnPluginStart()
{
    
HookEvent("player_incapacitated"Event_PlayerIncapacitated);
}

public 
void Event_PlayerIncapacitated(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int attacker GetClientOfUserId(event.GetInt("attacker"));

    if (
victim && IsClientInGame(victim) && attacker && IsClientInGame(attacker))
    {
        
PrintToChatAll("%N incapacitated %N"attackervictim);
    }

Attached Files
File Type: sp Get Plugin or Get Source (printchat_incapacitated.sp - 114 views - 490 Bytes)
__________________

Last edited by Marttt; 07-30-2021 at 09:15.
Marttt is offline
VladimirTk
Senior Member
Join Date: Apr 2021
Location: Perú - Latino América
Old 07-30-2021 , 08:20   Re: [L4d2] Request - Simple Plugin (ad when you incapacitate someone)
Reply With Quote #3

Thanks as always Martt I'm seeing it right now
VladimirTk 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 14:02.


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