Raised This Month: $105 Target: $400
 26% 

How do I make weapons invisible to other players?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pidda
Junior Member
Join Date: Mar 2009
Old 05-13-2009 , 20:42   How do I make weapons invisible to other players?
Reply With Quote #1

I just want to make the knife invisible to other players, for everything else I want to be able to see.

Last edited by pidda; 05-13-2009 at 20:50.
pidda is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-13-2009 , 21:25   Re: How do I make weapons invisible to other players?
Reply With Quote #2

Get the knife entity (perhaps using GetPlayerWeaponSlot) and then SetEntityRenderMode on it.
Fyren is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-13-2009 , 21:36   Re: How do I make weapons invisible to other players?
Reply With Quote #3

Quote:
Originally Posted by Fyren View Post
Get the knife entity (perhaps using GetPlayerWeaponSlot) and then SetEntityRenderMode on it.
So like this?

SetEntityRenderMode(weapon_knife, RENDER_NONE);

I have no idea what I am doing.

Last edited by pidda; 05-13-2009 at 21:45.
pidda is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 05-14-2009 , 00:09   Re: How do I make weapons invisible to other players?
Reply With Quote #4

new knife_entity = GetPlayerWeaponSlot(client, 2);
SetEntityRenderMode(knife_entity, RENDER_NONE);
__________________
pheadxdll is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-14-2009 , 00:32   Re: How do I make weapons invisible to other players?
Reply With Quote #5

Quote:
Originally Posted by pheadxdll View Post
new knife_entity = GetPlayerWeaponSlot(client, 2);
SetEntityRenderMode(knife_entity, RENDER_NONE);
Cool, but this wont compile. If I knew what I was doing I would know what to do with this.
pidda is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 05-14-2009 , 00:55   Re: How do I make weapons invisible to other players?
Reply With Quote #6

Code:
/* Plugin Template generated by Pawn Studio */

#include <sourcemod>
#include <sdktools>
#include <tf2>

public Plugin:myinfo = 
{
    name = "Invis Knife",
    author = "pheadxdll",
    description = "Test",
    version = "1.0",
    url = "<- URL ->"
}

public OnPluginStart()
{
    RegAdminCmd("sm_knife", Command_Knife, ADMFLAG_BAN);
}

public Action:Command_Knife(client, args)
{
    new knife_entity = GetPlayerWeaponSlot(client, 2);
    SetEntityRenderMode(knife_entity, RENDER_NONE);
    
    return Plugin_Handled;
}
__________________

Last edited by pheadxdll; 05-14-2009 at 00:59.
pheadxdll is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-14-2009 , 00:59   Re: How do I make weapons invisible to other players?
Reply With Quote #7

I don't have a plugin. I am doing this from scratch without prior knowledge of coding for sourcemod.
pidda is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-14-2009 , 00:59   Re: How do I make weapons invisible to other players?
Reply With Quote #8

/home/groups/sourcemod/upload_tmp/phpq2g8fU.sp(9) : error 017: undefined symbol "client"

1 Error.
pidda is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 05-14-2009 , 00:59   Re: How do I make weapons invisible to other players?
Reply With Quote #9

Try the snippet above. Go in-game, type sm_knife in console. Then taunt with the knife out and see if you see it.
__________________
pheadxdll is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-14-2009 , 01:00   Re: How do I make weapons invisible to other players?
Reply With Quote #10

Quote:
Originally Posted by pheadxdll View Post
Code:
/* Plugin Template generated by Pawn Studio */

#include <sourcemod>
#include <sdktools>
#include <tf2>

public Plugin:myinfo = 
{
    name = "Invis Knife",
    author = "pheadxdll",
    description = "Test",
    version = "1.0",
    url = "<- URL ->"
}

public OnPluginStart()
{
    RegAdminCmd("sm_knife", Command_Knife, ADMFLAG_BAN);
}

public Action:Command_Knife(client, args)
{
    new knife_entity = GetPlayerWeaponSlot(client, 2);
    SetEntityRenderMode(knife_entity, RENDER_NONE);
    
    return Plugin_Handled;
}
Ah, this looks amazing. This is for Counter-Strike Source by the way, I noticed it included "tf2"
pidda is offline
Reply


Thread Tools
Display Modes

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 00:59.


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