• Help with my no pre round killing script?
    4 replies, posted
Okay, so I'm trying to make a script which will make players godded when the preparing phase is on and then ungod when the real round begins. I found the TTT hooks and luckily enough for me there is a "TTTPrepareRound" and "TTTBeginRound" hook. However, I can not seem to get them to work with my GodEnable function. There is no error, so I added a check in each function to see if the hooks were actually being called when they were supposed to: [lua]function StopPreroundKilling() for k,v in pairs(player.GetAll()) do v:GodEnable() v:PrintMessage(HUD_PRINTTALK,"Prepareround has started!") end end hook.Add("TTTPrepareRound", "StopPreroundKilling", StopPreroundKilling) function AllowKilling() for k,v in pairs(player.GetAll()) do v:GodDisable() v:PrintMessage(HUD_PRINTTALK,"round has started!") end end hook.Add("TTTBeginRound", "AllowKilling", AllowKilling) [/lua] This is my code, and when the preparing stage "Prepareround has started!", prints to chat but I do not get godded. Then later on when the actual round begins, the message does print. Can anyone help?
Sorry if this doesn't help, I didn't really read your thread. If you set this in your server.cfg it will make it so players can not do damage preround: ttt_postround_dm 1 Also a bunch of handy TTT cvars: [url]http://ttt.badking.net/config-and-commands/convars[/url]
Ah, that says [QUOTE]Enables damage after a round has ended.[/QUOTE] Are you sure that works pre round?
Sorry I assumed postround because by default on my TTT server you can not kill players preround unless you push/goomba stomp them. **edit** Also this will cut down on preround kills as well: ttt_no_nade_throw_during_prep 1
The best way would be to hook into on player take damage, if the round state is not active then return 0;
Sorry, you need to Log In to post a reply to this thread.