AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help with invisibility plugin (https://forums.alliedmods.net/showthread.php?t=228453)

liquid321 10-19-2013 22:55

Help with invisibility plugin
 
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;
}


Taz532 10-20-2013 00:00

Re: Help with invisibility plugin
 
Last time I checked, it wasn't possible to set transparency on a person in cs:go using sourcemod.

liquid321 10-20-2013 17:32

Re: Help with invisibility plugin
 
@Taz532 - this plugin would be for Counter Strike Source.


All times are GMT -4. The time now is 20:34.

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