Y have made an item for the uwc3x mod that makes you for 10 seconds completly invizible but its to powerfull and y want to make it to be able to attack only with the knife while invs.
Here is the code for the item.
Activation on invizibility.
Code:
if( playeritem3[id] == INVIS)
{
set_entity_visibility ( id, 0 );
new parm[2];
parm[0] = id;
parm[1] = INVIS;
//Play sound
if( Util_Should_Msg_Client(id) )
{
set_hudmessage(0, 255, 255, 0.0, 0.55, 0, 6.0, 3.0, 0.1, 0.2, 1);
show_hudmessage(id, "%L", LANG_PLAYER, "SM3_INVIS", MOD);
if ( file_exists( "sound/uwc3x/shopmenu/sm3_inv.wav" ) == 1 )
{
emit_sound( id, CHAN_STATIC, "uwc3x/shopmenu/sm3_inv.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
}
}
//reset via task in 10 seconds
parm2[1] = 3;
set_task( 10.0, "Task_Reset_Shopmenu3", SHOPMENU3_RESET + id, parm2, 2);
}
Removing the invizibility.
Code:
else if( reset_item == 3 )
{
set_entity_visibility ( id, 1 );
if( Util_Should_Msg_Client(id) )
{
set_hudmessage(0, 255, 255, 0.0, 0.55, 0, 6.0, 3.0, 0.1, 0.2, 1);
show_hudmessage(id, "%L", LANG_PLAYER, "SM3_VISIBLE", MOD);
if ( file_exists( "sound/uwc3x/shopmenu/sm3_inv_done.wav" ) == 1 )
{
emit_sound( id, CHAN_STATIC, "uwc3x/shopmenu/sm3_inv_done.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
}
}
}