-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TTT: Added some useful things #1272
Conversation
Shit. I see that I've made a lot of things wrong with the hooks. :c |
Add C4 hooks :D |
I could do this, but not yet. I'm not at home this week. Am 07.11.2016 12:59 nachm. schrieb "mcNuggets1" notifications@github.com:
|
71ec6ea
to
9bccfcf
Compare
First I changed
|
For which events? (Disarm, Arm, Destroy, Pickup, Explode?) |
I hope the way I calculate everything is correct. |
end | ||
concommand.Add("ttt_debug_testhat", TestHat) | ||
concommand.Add("ttt_debug_testhat", TestHat, nil, nil, FCVAR_CHEAT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this function even exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be useful for model creators.
They can test if the hat fits to the models head.
@@ -308,4 +308,4 @@ function PANEL:DoRightClick() | |||
menu:Open() | |||
end | |||
|
|||
vgui.Register( "TTTScorePlayerRow", PANEL, "Button" ) | |||
vgui.Register( "TTTScorePlayerRow", PANEL, "DButton" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this change doesn't really matter.
Button is deprecated. Changing this does not make a big difference. But I had the time and making a new PR for something like this doesn't really make sense.
TTT Damagelogs is an outdated addon with a lot of bugs, even without C4 changes. |
Yes, TTT Damagelogs is outdated. The same thing is with the SpecDM. |
Progress is the future. By the way I don't think adding a hook breaks TTTDamagelogs, it just makes the solution of TTTDamagelogs integrating C4 hooks useless. |
I asked how the hooks should be named. My question was if I should name these hooks like the one from the Damagelog or if should give them other names. |
Ask svdm. It is not my gamemode. However if the hooks would do the same it would not break anything either. |
I hate GitHub. Edit: |
1d1ba9c
to
ccfa636
Compare
Can you list these bugs (MySQL and C4 excluded)? |
@MinIsMin I'll add these hooks when I know how to fix these annoying merge conflicts. |
@svdm Should I create a seperate PR for the C4 Hooks? I really don't know how to fix these merge conflicts. |
Sure, make a separate PR. I actually much prefer a PR to only make changes related to a single feature/bug, that makes it faster to review and merge. |
@svdm |
local function SetDisguise(ply, cmd, args) | ||
if not IsValid(ply) or not ply:IsActiveTraitor() then return end | ||
|
||
if ply:HasEquipmentItem(EQUIP_DISGUISE) then | ||
local state = #args == 1 and tobool(args[1]) | ||
if not hook.Run("TTTToggleDisguiser", ply, state) == false then return end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be that I have killed the disguiser? I have to test this again later.
(Because I'm checking if the hook returns anything other then false. So if it returns nil it wouldn't work, would it?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returning nil will have the same effect as returning false there, which i think you don't want
A small overview of the changes and some informations about them:
sv_cheats 1
. Now the FlagFCVAR_CHEAT
is used because this is a bit better because it tells the client that the command requiressv_cheats 1
.Hook Name:
TTTCanUseTraitorButton
Arguments:
ttt_traitor_button-Entity; Player that used the Button
(self, ply
)Return: Return false to prevent using it. You can also return a message that is shown up if you aren't allowed to use the button. (Example:
return false, "Not allowed."
)TTTEndRound
(Serverside only) that gives the information if the round end was triggered by the map.(Could be useful for some addons.)
Hook Name:
TTTCanToggleDisguiser
Arguments:
player that toggles the disguiser; boolean that tells to which state the disguiser would be changed.
Return: Return false to prevent toggling the disguiser.
(This is very useful for addons like the PowerRound-Addon or the TTTDamagelog-Addon.)