Raised This Month: $ Target: $400
 0% 

wcft 3 item help!!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
joker231
Junior Member
Join Date: Dec 2008
Old 12-30-2008 , 23:31   wcft 3 item help!!
Reply With Quote #1

hey guys...so i want a item that u can buy in shopmenu3 (yes...i made a new shopmenu) and basically what it does is allows you 2 see humans if you buy it...can some1 help me with the code?

heres the code 2 make the human invisible in the first place...

Code:
// This should be called on weapon change, on new round, when the user selects a new skill, and after an item is purchased
public SHARED_INVIS_Set( id )
{
   // Do not want to set them as invisible if the player is currently rendering
   if ( !p_data_b[id][PB_CAN_RENDER] || !p_data_b[id][PB_ISCONNECTED] )
   {
      return;
   }

   new iInvisLevel = 0;

   static iSkillLevel;
   iSkillLevel = SM_GetSkillLevel( id, 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( id, 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( id ) )
   {
      iInvisLevel /= 2;
   }

   if ( iInvisLevel )
   {
      set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, iInvisLevel );
      
      p_data_b[id][PB_INVIS] = true;
   }

   // User should not be invisible
   else
   {
      set_user_rendering( id );

      p_data_b[id][PB_INVIS] = false;
   }

   return;
}
joker231 is offline
 



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