Somebody know how to make rope hang a bit?
- m_RopeLength (Offset 936) (Save)(4 Bytes)
I think it should do it, but dont know how to change it
PHP Code:
SpawnRope( Float:nodes[][ 3 ], NodeCount, const String:NodePrefix[], const String:RopeMaterial[] = "cable/cable.vmt", Float:width = 2.0, slack = 0, bool:LastNodeToFirst = false )
{
if( NodeCount < 2 )
return 0;
new ent, i;
decl String:NodeName[ 64 ], String:NextNodeName[ 64 ];
for(; i < NodeCount; i++ )
{
if( i == 0 )
ent = CreateEntityByName( "move_rope" );
else
ent = CreateEntityByName( "keyframe_rope" );
if( !IsValidEntity( ent ) )
return i;
Format( NodeName, sizeof( NodeName ), "%s%d", NodePrefix, i );
if( NodeCount > i + 1 )
Format( NextNodeName, sizeof( NextNodeName ), "%s%d", NodePrefix, i + 1 );
else
{
if( LastNodeToFirst )
Format( NextNodeName, sizeof( NextNodeName ), "%s0", NodePrefix );
else
strcopy( NextNodeName, sizeof( NextNodeName ), "" );
}
DispatchKeyValue( ent, "targetname", NodeName );
DispatchKeyValue( ent, "NextKey", NextNodeName );
DispatchKeyValue( ent, "RopeMaterial", RopeMaterial );
DispatchKeyValueFloat( ent, "Width", width );
DispatchKeyValue( ent, "Slack", "1" );
DispatchKeyValue( ent, "Type", "0" );
DispatchKeyValue( ent, "TextureScale", "1" );
DispatchKeyValue( ent, "Subdiv", "2" );
DispatchKeyValueFloat( ent, "m_RopeLength", 10.0 ); //this should change rope length? - m_RopeLength (Offset 936) (Save)(4 Bytes)
DispatchKeyValue( ent, "MoveSpeed", "0" );
DispatchKeyValue( ent, "Dangling", "0" );
DispatchKeyValue( ent, "Collide", "0" );
DispatchKeyValue( ent, "Breakable", "0" );
DispatchKeyValue( ent, "Barbed", "0" );
DispatchSpawn( ent );
TeleportEntity( ent, nodes[ i ], NULL_VECTOR, NULL_VECTOR );
CreateTimer( 0.1, Timer_ActivateEntity, ent );
}
return i;
}