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

Set user weapon rendering


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-10-2011 , 13:02   Set user weapon rendering
Reply With Quote #1

Hello all, I have tried many times set weapon rendering for user, but always fail. Sorry for my english.

So what i have:

For user player model (example):
Enable cloaking:
Code:
set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 12 );
Disable cloaking:
Code:
set_user_rendering( id )
But i also need do this for player weapon (player should see is him cloaking).

Last variant of code is:

Code:
//get weapon id
stock get_weapon_ent(id,wpnid=0,wpnName[]="")
{
        // who knows what wpnName will be
        static newName[24];

        // need to find the name
        if(wpnid) get_weaponname(wpnid,newName,23);

        // go with what we were told
        else formatex(newName,23,"%s",wpnName);

        // prefix it if we need to
        if(!equal(newName,"weapon_",7))
                format(newName,23,"weapon_%s",newName);

        return fm_find_ent_by_owner(get_maxplayers(),newName,id);
}
Enable cloaking:
Code:
		new weapond = get_user_weapon(id)
		new weapon_ent = get_weapon_ent(id,weapond)
		set_pev(weapon_ent, pev_renderfx, kRenderFxNone)
		set_pev(weapon_ent, pev_rendercolor, {0.0,0.0,0.0})
		set_pev(weapon_ent, pev_rendermode, kRenderTransAlpha)
		set_pev(weapon_ent, pev_renderamt, 12.0)
Disable cloaking:
Code:
		new weapond = get_user_weapon(id)
		new weapon_ent = get_weapon_ent(id,weapond)
		set_pev(weapon_ent, pev_rendercolor, {255.0,255.0,255.0})
		set_pev(weapon_ent, pev_rendermode, kRenderNormal)
		set_pev(weapon_ent, pev_renderamt, 255.0)
But this not working... I'm also tried just "set_rendering" for weapon ent, but again fail.

How do this with player weapon? Are this possible? Please help. I hope someone understand what i mean.
__________________

Last edited by AlexALX; 09-10-2011 at 13:27.
AlexALX is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 09-10-2011 , 14:32   Re: Set user weapon rendering
Reply With Quote #2

If you mean v_models, then no, it isn't possible.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-10-2011 , 15:17   Re: Set user weapon rendering
Reply With Quote #3

bibu yes... But maybe this possible with some amxmodx module?
__________________
AlexALX is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-10-2011 , 15:35   Re: Set user weapon rendering
Reply With Quote #4

Quote:
Originally Posted by AlexALX View Post
bibu yes... But maybe this possible with some amxmodx module?
It was discussed many times before, it is impossible.
__________________
xPaw is offline
Old 09-10-2011, 16:53
BodyBuilder
This message has been deleted by BodyBuilder.
bibu
Veteran Member
Join Date: Sep 2010
Old 09-10-2011 , 17:34   Re: Set user weapon rendering
Reply With Quote #5

Well you would need to use seperate models then. So it's not that what the OP wants.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 16:58.


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