AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [CS:GO] Disable playerx saved playerx by... (https://forums.alliedmods.net/showthread.php?t=243360)

TheWho 07-03-2014 11:25

[CS:GO] Disable playerx saved playerx by...
 
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 :wink:)

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

rswallen 07-03-2014 12:19

Re: [CS:GO] Disable playerx saved playerx by...
 
It's case sensitive
PHP Code:

if (StrContains(message"save"false) != -1

shouold work fine

TheWho 07-03-2014 19:07

Re: [CS:GO] Disable playerx saved playerx by...
 
Wow nvm, I was tired, thanks.

JoB2C 07-04-2014 05:17

Re: [CS:GO] Disable playerx saved playerx by...
 
Good work !

Quote:

PbReadString(pb, "params", message, sizeof(message), 0);
Warning gone o/
1.6.0 compatibility o/

TheWho 07-05-2014 07:55

Re: [CS:GO] Disable playerx saved playerx by...
 
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 :)


All times are GMT -4. The time now is 18:38.

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