Spawn detection Script
The script for detecting spawning of players needs to be executed from the state files. The spawn detection script then handles the rest of things.
What to add
The line “exec global/ac/spawn_detect.scr 1” needs to be added. The 1 simply tells the script it is form the state files.
Where to add
You need to add the line under the entrycommands section of state RAISE_WEAPON. The player rises their weapon each time they spawn. Any other time is ignored by the script.
The final result should look something like this:
|
state RAISE_WEAPON { movetype legs
entrycommands { viewmodelanim pullout
//exec skill_balancer/player_thread.scr // just to make sure nothing funky's // attached that shouldn't be. correctweaponattachments exec global/ac/spawn_detect.scr 1 }
states { RAISE_PISTOL : IS_NEW_WEAPONCLASS "mainhand" "pistol" RAISE_RIFLE : IS_NEW_WEAPONCLASS "mainhand" "rifle" RAISE_GRENADE : IS_NEW_WEAPONCLASS "mainhand" "grenade" RAISE_SMG : IS_NEW_WEAPONCLASS "mainhand" "smg" RAISE_MG : IS_NEW_WEAPONCLASS "mainhand" "mg" // RAISE_PISTOL : IS_NEW_WEAPONCLASS "mainhand" "item" // hold all items like a pistol for now RAISE_HEAVY : IS_NEW_WEAPONCLASS "mainhand" "heavy" RAISE_PAPERS : IS_NEW_WEAPON "mainhand" "Papers"
// RAISE_RIFLE : default RAISE_NOANIM : default } } |