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

[CS:GO] Disable playerx saved playerx by...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 07-03-2014 , 11:25   [CS:GO] Disable playerx saved playerx by...
Reply With Quote #1

Hi,

Im not interested in getting a approve for any plugin, accept it or not so I post it here.
(There is one warning about that I dont care )

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

new UserMsg:p_Msg;

public 
Plugin:myinfo =
{
    
name "[CS:GO] No Player Saved msg",
    
author "TheWho",
    
description "No Player Saved msg",
    
version "1.0",
    
url "http://www.sourcemod.net"
}

public 
OnPluginStart()
{
    
p_Msg GetUserMessageId("TextMsg");
    
HookUserMessage(p_MsgpBlockSaveMsgtrue);
}

public 
Action:pBlockSaveMsg(UserMsg:msg_idHandle:pb, const players[], playersNumbool:reliablebool:init)
{
    if (!
reliable)
        return 
Plugin_Continue;
    
decl String:message[256];
    
PbReadRepeatedString(pb"params"0message256);
    if (
StrContains(message"#Chat_SavePlayer_Saved") != -1)
    {
        return 
Plugin_Handled;
    }
    else if (
StrContains(message"#Chat_SavePlayer_Savior") != -1)
    {
        return 
Plugin_Handled;
    }
    else if (
StrContains(message"#Chat_SavePlayer_Spectator") != -1)
    {
        return 
Plugin_Handled;
    }
    else
        return 
Plugin_Continue;

Credits goes to Protobuf, Barcadi and me for finding the Strings only.

__
Maybe you can say me why
PHP Code:
if (StrContains(message"save") != -1
doesn't work in this case o.O

Last edited by TheWho; 07-03-2014 at 11:30.
TheWho is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 07-03-2014 , 12:19   Re: [CS:GO] Disable playerx saved playerx by...
Reply With Quote #2

It's case sensitive
PHP Code:
if (StrContains(message"save"false) != -1
shouold work fine
rswallen is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 07-03-2014 , 19:07   Re: [CS:GO] Disable playerx saved playerx by...
Reply With Quote #3

Wow nvm, I was tired, thanks.
TheWho is offline
JoB2C
AlliedModders Donor
Join Date: Jan 2014
Location: France
Old 07-04-2014 , 05:17   Re: [CS:GO] Disable playerx saved playerx by...
Reply With Quote #4

Good work !

Quote:
PbReadString(pb, "params", message, sizeof(message), 0);
Warning gone o/
1.6.0 compatibility o/
JoB2C is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 07-05-2014 , 07:55   Re: [CS:GO] Disable playerx saved playerx by...
Reply With Quote #5

Yes I know that it was this problem, but I was to lazy to look why it throws a warn, it was for version 1.6, thanks
TheWho 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 02:25.


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