Raised This Month: $ Target: $400
 0% 

wcft 3 item help!!


Post New Thread Reply   
 
Thread Tools Display Modes
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 12-31-2008 , 02:16   Re: wcft 3 item help!!
Reply With Quote #11

but heres where i get lost what do i use to make them 50% or 75% invisble and where do i put the number?
whosyourdaddy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-31-2008 , 02:18   Re: wcft 3 item help!!
Reply With Quote #12

Code:
set_es(ES,ES_RenderAmt,0)

The 0 value can range from 0-255. 255 = 100% visible. 0 = 0% visible (totally invisible).
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 12-31-2008 , 02:35   Re: wcft 3 item help!!
Reply With Quote #13

is this how it works

Code:
// This should be called on weapon change, on new round, when the user selects a new skill, and after an item is purchased
 
ForwardAddToFullPack(ES,e,Ent,Host,HostFlags,Player,pSet)
{
   // Do not want to set them as invisible if the player is currently rendering
   if ( !p_data_b[ent][PB_CAN_RENDER] || !p_data_b[ent][PB_ISCONNECTED] )
   {
      return;
   }
 
   new iInvisLevel = 0;
 
   static iSkillLevel;
   iSkillLevel = SM_GetSkillLevel( ent, SKILL_INVISIBILITY );
 
   // If they are Human Alliance with Invisibility lets set the level
   if ( iSkillLevel > 0 )
   {
      iInvisLevel = p_invisibility[iSkillLevel-1];
   }
 
   // User has a Cloak of Invisibility
   if ( ITEM_Has( ent, ITEM_CLOAK ) > ITEM_NONE )
   {
      // Then we are already a little invis, lets give them a little bonus for purchasing the item
      if ( iInvisLevel > 0 )
      {
         iInvisLevel = floatround( float( iInvisLevel ) / INVIS_CLOAK_DIVISOR );
      }
      else
      {
         iInvisLevel = get_pcvar_num( CVAR_wc3_cloak );
      }
   }
 
   // If the player is holding a knife they should be more invisible
   if ( SHARED_IsHoldingKnife( ent ) )
   {
      iInvisLevel /= 2;
   }
 
   if ( iInvisLevel )
   {
      if(p_data_b[ent][PB_INVIS] && ITEM_Has(player,ITEM_GOGGLES) == ITEM_NONE)
{
        set_es(ES,ES_Solid,SOLID_NOT)
        set_es(ES,ES_RenderMode,kRenderTransAlpha)
        set_es(ES,ES_RenderAmt,iInvisLevel)
}
 
      p_data_b[ent][PB_INVIS] = true;
   }
 
   // User should not be invisible
   else
   {
      set_user_rendering( ent );
 
      p_data_b[ent][PB_INVIS] = false;
   }
 
   return;
}
think you can tell me what

ES
e
Ent
Host
HostFlags
Player
pSet

are

Last edited by whosyourdaddy; 12-31-2008 at 02:37.
whosyourdaddy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-31-2008 , 03:11   Re: wcft 3 item help!!
Reply With Quote #14

No, you just blended the code after I told you specifically how to do it. The only important parameters are "ES", "Host" and "Ent" which I already explained.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 12-31-2008 , 03:26   Re: wcft 3 item help!!
Reply With Quote #15

well arent i suppose to blend it so i know how invisble to make them?
whosyourdaddy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-31-2008 , 03:34   Re: wcft 3 item help!!
Reply With Quote #16

Quote:
Originally Posted by Hawk552 View Post
What you'll need to do is remove all of the code that makes the humans invisible and replace it with a hook to "FM_AddToFullPack". In here, you'll have to set the rendering of the player according to what you want the viewer to see.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 12-31-2008 , 03:39   Re: wcft 3 item help!!
Reply With Quote #17

can u give me an example please
whosyourdaddy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-31-2008 , 03:40   Re: wcft 3 item help!!
Reply With Quote #18

I already did. The only thing you have to do is remove the rendering code from the original item.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 12-31-2008 , 03:44   Re: wcft 3 item help!!
Reply With Quote #19

you have ur invisble set to 0 and you told me not to combine the codes so can u give me an example on how i can get what i want my invisble level to be without combining the codes
whosyourdaddy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-31-2008 , 03:48   Re: wcft 3 item help!!
Reply With Quote #20

Okay, you remove the set_user_rendering() code and anything to do with it from the original script. You then add the register_forward() call for FM_AddToFullPack in plugin_init() (note that it should be in the post setting, or you can just copy and paste the forward hook that I gave a few posts back). Next, you copy and paste the function I gave you, but not into the function for the item. ForwardAddToFullPacks() is a function on its own and as such should be placed independently of the other functions.

Finally, you will have to modify the calls in the function that I gave you because it clearly won't work as is, although the logic is sound. You seemed to have gotten this step done properly although I didn't really look at it.

Also, I'm going to make my other post more clear:

Quote:
Originally Posted by Hawk552 View Post
Code:
set_es(ES,ES_RenderAmt,0)

The 0 value can range from 0-255.
255 = 100% visible (you can see the player).
0 = 0% visible (the player is totally invisible).
__________________

Last edited by Hawk552; 12-31-2008 at 03:50.
Hawk552 is offline
Send a message via AIM to Hawk552
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 09:16.


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