AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How do I make weapons invisible to other players? (https://forums.alliedmods.net/showthread.php?t=92335)

pidda 05-13-2009 19:42

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

Fyren 05-13-2009 20:25

Re: How do I make weapons invisible to other players?
 
Get the knife entity (perhaps using GetPlayerWeaponSlot) and then SetEntityRenderMode on it.

pidda 05-13-2009 20:36

Re: How do I make weapons invisible to other players?
 
Quote:

Originally Posted by Fyren (Post 827056)
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.

pheadxdll 05-13-2009 23:09

Re: How do I make weapons invisible to other players?
 
new knife_entity = GetPlayerWeaponSlot(client, 2);
SetEntityRenderMode(knife_entity, RENDER_NONE);

pidda 05-13-2009 23:32

Re: How do I make weapons invisible to other players?
 
Quote:

Originally Posted by pheadxdll (Post 827101)
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.

pheadxdll 05-13-2009 23:55

Re: How do I make weapons invisible to other players?
 
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;
}


pidda 05-13-2009 23:59

Re: How do I make weapons invisible to other players?
 
I don't have a plugin. I am doing this from scratch without prior knowledge of coding for sourcemod.

pidda 05-13-2009 23:59

Re: How do I make weapons invisible to other players?
 
/home/groups/sourcemod/upload_tmp/phpq2g8fU.sp(9) : error 017: undefined symbol "client"

1 Error.

pheadxdll 05-13-2009 23:59

Re: How do I make weapons invisible to other players?
 
Try the snippet above. Go in-game, type sm_knife in console. Then taunt with the knife out and see if you see it.

pidda 05-14-2009 00:00

Re: How do I make weapons invisible to other players?
 
Quote:

Originally Posted by pheadxdll (Post 827117)
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"


All times are GMT -4. The time now is 05:45.

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