So in zombie survival, when you use +zoom it allows you to phase through props. But there is an issue of props on top of ladders. If you press your +zoom bind before you get on the ladder, it works. But I want to make it so you can press it while on the ladder. I know for a fact this is possible, for I played on a server that accomplished it. Does anyone know where to start?
I'm a lua noob, so these are just some link to things:
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8173.html[/url]
"MOVETYPE_LADDER = 9 -- For players, when moving on a ladder."
Below is not real code, but how I start to figure this out:
[code]
if (pl:Alive() && (all the other valid checks you want) && key == +zoom && MOVETYPE_LADDER ) then
cycle through your prop code
end
[/code]
1. I used GMAD Extractor to extract all the files within zombie_survival_105462463.gma after subscribing to it.
2. I used Agent Ransack to search within all the files for the word "zoom".
3. I see "In_ZOOM" in the init.lua, so I opened it up in Notepad++
4. I found:
[code]
function GM:KeyPress(pl, key)
if key == IN_USE then
if pl:Team() == TEAM_HUMAN and pl:Alive() then
if pl:IsCarrying() then
pl.status_human_holding:Remove()
else
self:TryHumanPickup(pl, pl:TraceLine(64).Entity)
end
end
elseif key == IN_SPEED then
if pl:Alive() then
if pl:Team() == TEAM_HUMAN then
pl:DispatchAltUse()
elseif pl:Team() == TEAM_UNDEAD then
pl:CallZombieFunction("AltUse")
end
end
elseif key == IN_ZOOM then
if pl:Team() == TEAM_HUMAN and pl:Alive() and pl:IsOnGround() and not self.ZombieEscape then --and pl:GetGroundEntity():IsWorld() then
pl:SetBarricadeGhosting(true)
end
end
end
[/code]
5. Like I said, I'm a noob, so I don't know if this is the right approach.
I think the pl:IsOnGround() is returning false if you're on a ladder. You can get rid of that but I'm not sure if that will have any negative impacts or not.
[QUOTE=thegrb93;43891509]I think the pl:IsOnGround() is returning false if you're on a ladder. You can get rid of that but I'm not sure if that will have any negative impacts or not.[/QUOTE]
Replace
pl:IsOnGround()
with
(pl:IsOnGround() or pl:GetMoveType()==MOVETYPE_LADDER)
Should work.
Thank you very much
The pl:IsOnGround() or pl:GetMoveType()==MOVETYPE_LADDER did not work, but removing pl:IsOnGround() worked beautifully.
Thanks
[QUOTE=swinginman;43895460]Thank you very much
The pl:IsOnGround() or pl:GetMoveType()==MOVETYPE_LADDER did not work, but removing pl:IsOnGround() worked beautifully.
Thanks[/QUOTE]
And now you can bunnyhop through the props for maximum abuse. Try using the brackets like he posted.
You wanna elaborate? I cant see how being able to suite zoom in the air results in bunny hopping ._.
When I used the pl:IsOnGround() or pl:GetMoveType()==MOVETYPE_LADDER it worked, but the first time you suit zoom through a prop, you get a strange error isn't coming from the gamemode.
And the with the extra ()'s it just doesn't looks right.
[code]if pl:Team() == TEAM_HUMAN and pl:Alive() and (pl:IsOnGround() or pl:GetMoveType()==MOVETYPE_LADDER) and not self.ZombieEscape then[/code]
Why?^
Sorry, you need to Log In to post a reply to this thread.