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

How do I make weapons invisible to other players?


Post New Thread Reply   
 
Thread Tools Display Modes
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 05-14-2009 , 00:02   Re: How do I make weapons invisible to other players?
Reply With Quote #11

Good catch, try this then:

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

#include <sourcemod>
#include <sdktools_functions>

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;
}
Actually, since this is for CSS, I don't know what slot is the right one. We need some CSS sourcemod'er to comment and help us out. I don't play CSS.
__________________
pheadxdll is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-14-2009 , 00:29   Re: How do I make weapons invisible to other players?
Reply With Quote #12

It compiles but it doesn't work. I can still see the knife. Maybe it isn't the right slot?

Getting this error:


L 05/14/2009 - 04:46:51: [SM] Native "GetPlayerWeaponSlot" reported: World not allowed
L 05/14/2009 - 04:46:51: [SM] Displaying call stack trace for plugin "sm_knife.smx":
L 05/14/2009 - 04:46:51: [SM] [0] Line 24, /home/groups/sourcemod/upload_tmp/phpUTAmqO.sp::Command_Knife()
L 05/14/2009 - 04:46:51: rcon from "xx.xx.xxx.xxxxx": command "sm_knife"

Last edited by pidda; 05-14-2009 at 01:03.
pidda is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-14-2009 , 18:24   Re: How do I make weapons invisible to other players?
Reply With Quote #13

Do sm_knife in your client console, not the server console/rcon. Or say /knife or !knife in chat, which would achieve the same thing.
Fyren is offline
pidda
Junior Member
Join Date: Mar 2009
Old 05-14-2009 , 20:46   Re: How do I make weapons invisible to other players?
Reply With Quote #14

Quote:
Originally Posted by Fyren View Post
Do sm_knife in your client console, not the server console/rcon. Or say /knife or !knife in chat, which would achieve the same thing.
ah
pidda is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 05-14-2009 , 21:45   Re: How do I make weapons invisible to other players?
Reply With Quote #15

Code:
#include <sdktools_functions>
Change that to

Code:
#include <sdktools>
You can do it the way you did, but your only including a small portion of sdktool's natives, it's a better habit to include the whole thing.
__________________
Greyscale is offline
viRR
Member
Join Date: Mar 2011
Location: Slovakia
Old 03-17-2012 , 16:13   Re: How do I make weapons invisible to other players?
Reply With Quote #16

Code:
L 03/17/2012 - 21:09:22: [SM] Native "GetPlayerWeaponSlot" reported: Entity index 0 is not a valid client
L 03/17/2012 - 21:09:22: [SM] Displaying call stack trace for plugin "knife.smx":
L 03/17/2012 - 21:09:22: [SM]   [0]  Line 22, knife.sp::Command_Knife()
It doesn't work on CS:S, could anyone fix it, PLS ?? THX a lot... (sorry for my english)

Last edited by viRR; 03-17-2012 at 16:14.
viRR is offline
Send a message via Skype™ to viRR
necavi
Veteran Member
Join Date: Sep 2010
Old 03-17-2012 , 16:25   Re: How do I make weapons invisible to other players?
Reply With Quote #17

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

#include <sourcemod>
#include <sdktools_functions>

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

public 
OnPluginStart()
{
    
RegAdminCmd("sm_knife"Command_KnifeADMFLAG_BAN);
}



public 
Action:Command_Knife(clientargs)
{
    new 
knife_entity GetPlayerWeaponSlot(client2);
    if(
IsValidEntity(knife_entity))
    {
        
SetEntityRenderMode(knife_entityRENDER_NONE);
    }
    
    return 
Plugin_Handled;


Last edited by necavi; 03-17-2012 at 16:26.
necavi is offline
viRR
Member
Join Date: Mar 2011
Location: Slovakia
Old 03-17-2012 , 16:38   Re: How do I make weapons invisible to other players?
Reply With Quote #18

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

#include <sourcemod>
#include <sdktools_functions>

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

public 
OnPluginStart()
{
    
RegAdminCmd("sm_knife"Command_KnifeADMFLAG_BAN);
}



public 
Action:Command_Knife(clientargs)
{
    new 
knife_entity GetPlayerWeaponSlot(client2);
    if(
IsValidEntity(knife_entity))
    {
        
SetEntityRenderMode(knife_entityRENDER_NONE);
    }
    
    return 
Plugin_Handled;


It still isn't working... ;(

L 03/17/2012 - 21:09:22: [SM] Native "GetPlayerWeaponSlot" reported: Entity index 0 is not a valid client
L 03/17/2012 - 21:09:22: [SM] Displaying call stack trace for plugin "knife.smx":
L 03/17/2012 - 21:09:22: [SM] [0] Line 22, knife.sp::Command_Knife()
viRR is offline
Send a message via Skype™ to viRR
necavi
Veteran Member
Join Date: Sep 2010
Old 03-17-2012 , 16:44   Re: How do I make weapons invisible to other players?
Reply With Quote #19

That means you're running it using sm_rcon, rcon or from the server's console.

I should've caught that from the first message, my apologies.

Last edited by necavi; 03-17-2012 at 16:45.
necavi is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-20-2012 , 14:05   Re: How do I make weapons invisible to other players?
Reply With Quote #20

Knife is in slot 3? or am i think wrong here? you push "3' to switch to it?
Mitchell 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 19:29.


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