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;
}