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

Help with invisibility plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
liquid321
Junior Member
Join Date: Apr 2006
Old 10-19-2013 , 22:55   Help with invisibility plugin
Reply With Quote #1

Hello,

I am trying to make a plugin that makes a player invisible (partially invisible) when they have a specific weapon pulled out (knife). This is what i have so far, it compilied fine but does not work.

Anyone that has some input, help would be greatly appreciated.

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#define PL_VERSION "0.1"

new Handle:g_hAmount;

public Plugin:myinfo = {
    name        = "Knife Invisible",
    author      = "MUNDA",
    description = "Knife out = invisible",
    version     = PL_VERSION,
    url         = "http://www.gamerzgonewild.com/"
};

public OnPluginStart() {
    CreateConVar("sm_knife_invisible_version", PL_VERSION, "Knife out = invisible", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    g_hAmount = CreateConVar("sm_knife_invisible_amount", "150", "Amount of visibility", FCVAR_PLUGIN, true, 0.0, true, 255.0);
    
    RegConsoleCmd("lastinv", Command_Weapon);
    RegConsoleCmd("invnext", Command_Weapon);
    RegConsoleCmd("invprev", Command_Weapon);
    RegConsoleCmd("slot1",   Command_Weapon);
    RegConsoleCmd("slot2",   Command_Weapon);
    RegConsoleCmd("slot3",   Command_Weapon);
    RegConsoleCmd("slot4",   Command_Weapon);
    RegConsoleCmd("slot5",   Command_Weapon);
    RegConsoleCmd("slot6",   Command_Weapon);
    RegConsoleCmd("slot7",   Command_Weapon);
    RegConsoleCmd("slot8",   Command_Weapon);
    RegConsoleCmd("slot9",   Command_Weapon);
    RegConsoleCmd("slot10",  Command_Weapon);
}

public Action:Command_Weapon(client, args) {
    decl String:sWeapon[32];
    GetClientWeapon(client, sWeapon, sizeof(sWeapon));
    SetEntData(client, FindSendPropInfo("CBasePlayer", "m_clrRender") + 3, StrEqual(sWeapon, "weapon_knife") ? GetConVarInt(g_hAmount) : 255, 1, true);
    
    return Plugin_Continue;
}
liquid321 is offline
Taz532
Senior Member
Join Date: Jul 2011
Location: Michigan
Old 10-20-2013 , 00:00   Re: Help with invisibility plugin
Reply With Quote #2

Last time I checked, it wasn't possible to set transparency on a person in cs:go using sourcemod.
Taz532 is offline
liquid321
Junior Member
Join Date: Apr 2006
Old 10-20-2013 , 17:32   Re: Help with invisibility plugin
Reply With Quote #3

@Taz532 - this plugin would be for Counter Strike Source.
liquid321 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:19.


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