this plugins hooks infected spawning functions and delegates it to plugins based on a config file
plugin:
https://github.com/arthurdead/sm-plu...oreinfected.sp
gamedata:
https://github.com/arthurdead/sm-plu...reinfected.txt
you NEED DHooks2 with detour support:
https://github.com/peace-maker/DHooks2
OPTIONALLY requires:
https://forums.alliedmods.net/showthread.php?t=330933 for server-side infected
https://forums.alliedmods.net/showthread.php?t=331025 for navmesh place support
https://forums.alliedmods.net/showthread.php?t=331191 for death animations on bonemerged models
for example you have a file like this:
sourcemod/data/moreinfected.txt
Code:
"moreinfected"
{
"re_classiczombie"
{
"class_flags" "common"
"weight" "20"
"plugin" "re_npcs.smx"
}
"re_tyrant"
{
"class_flags" "tank|witch"
"weight" "100"
"plugin" "re_npcs.smx"
}
"special_common_infected"
{
"alias" "infected"
"class_flags" "common"
"hook" "post"
"weight" "50"
"plugin" "moreinfected.smx"
"data"
{
"bonemerge" "1"
"server" "1"
"gender" "male"
"variations"
{
"0"
{
"model" "models/infected/hulk.mdl"
"weight" "25"
}
"1"
{
"model" "models/infected/smoker.mdl"
"weight" "25"
}
}
}
}
}
every time a common infected is spawned the plugin will get a random entry from the file based on the weight value that has the "common" class_flags then a function named "{entryname}_spawn_common" will be called in the specified plugin
for special infected its the same deal except the function name is "{entryname}_spawn_special"
plugins should not precache stuff OnMapStart but instead make a function named "{entryname}_precache"
this plugin was mainly made to be used with this:
https://forums.alliedmods.net/showthread.php?t=331025
heres a unfinished example:
https://github.com/arthurdead/sm_npc...ing/re_npcs.sp