Can save any entity in the safe house. By default, it save all weapons, physic prop and mounted gun.
All data save in "sourcemod/data/save_entities" folder.
Blocked original save entities function to this plugin instead.
Config:
"l4d_customize_transition_entities.cfg" in "sourcemod/data". (Can change file path by a convar in below)
Spoiler
PHP Code:
"cfg"
{
"RemoveList" // List of entities to remove from the next level first checkpoint.
{
"classname" "prop_physics"
"propname" "m_iPrimaryAmmoType" // Add entities which has this property name to remove list
"propname" "m_weaponID" // Add entities which has this property name to remove list
"propname" "m_maxYaw" // Add entities which has this property name to remove list
}
"SaveList" // List of entities to save.
{
"classname" "prop_physics"
"propname" "m_iPrimaryAmmoType" // Add entities which has this property name to remove list
"propname" "m_weaponID" // Add entities which has this property name to remove list
"propname" "m_maxYaw" // Add entities which has this property name to remove list
}
// Save data
"all"
{
"PropData" // No matter what PropType is.
{
"PreSpawn" // Should set this property before spawn
{
"m_nSkin" "0"
}
}
}
// "classname"
// {
// "weapon_pistol"
// {
// "Offsets"
// {
// "5152"
// {
// "type" "int"
// "byte" "4"
// }
// "1" "float"
// }
// }
// }
"propname"
{
"m_iPrimaryAmmoType"
{
"PropData"
{
"PreSpawn"
{
// Property name element
"m_strMapSetScriptName" "0"
}
"PostSpawn"
{
// Property name element
"m_iClip1" "0"
"m_iExtraPrimaryAmmo" "0"
"m_upgradeBitVec" "0"
"m_nUpgradedPrimaryAmmoLoaded" "0"
}
}
}
"m_weaponID"
{
"PropData"
{
"PreSpawn"
{
// Property name element
"m_weaponID" "0"
"m_itemCount" "0"
"m_nWeaponSkin" "0"
}
}
}
"m_maxYaw"
{
"PropData"
{
"PreSpawn"
{
// Property name element
"m_maxYaw" "0"
"m_maxPitch" "0"
"m_minPitch" "0"
}
}
}
}
}
In "Offsets" section, only int type should be like this:
/**
* @brief Check the given entity wether or not in checkpoint area.
*
* @return True if is in checkpoint area, false otherwise or don't have checkpoint.
*/
native bool IsEntityInCheckpoint(int entity, CheckpointType checkpoint);
Forwards:
Spoiler
PHP Code:
/**
* @brief Called whenever entity is transitioning
*
* @param entity Entity index.
* @param datapack Datapack for entity to store.
*
* @return Plugin_Handled to don't save this entity.
*/
forward Action OnEntityTransitioning(int entity, KeyValues datapack);
/**
* @brief Called whenever transition entity created and before spawn
*
* @param entity Entity index.
* @param datapack Datapack for entity to restore.
*
*/
forward void OnEntityRestoringPreSpawn(int entity, KeyValues datapack);
/**
* @brief Called whenever transition entity created and post spawn
*
* @param entity Entity index.
* @param datapack Datapack for entity to restore.
*
*/
forward void OnEntityRestoringPostSpawn(int entity, KeyValues datapack);
Cvar:
PHP Code:
l4d_customize_transition_entities "1" // Enable the plugin.
l4d_customize_transition_entities_config "addons/sourcemod/data/l4d_customize_transition_entities.cfg" // Config file for entities and data to save.