Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return hook.Add('PlayerBindPress', 'PPM2.Ponyfly', function(self, bind, pressed)
- if bind == nil then
- bind = ''
- end
- if pressed == nil then
- pressed = false
- end
- if not ALLOW_FLIGHT:GetBool() then
- return
- end
- if not FLIGHT_BIND:GetBool() then
- return
- end
- if not pressed then
- return
- end
- if bind ~= '+jump' and bind ~= 'jump' then
- return
- end
- if lastDouble > RealTimeL() then
- if not self:IsPonyCached() then
- return
- end
- local data = self:GetPonyData()
- if not data then
- return
- end
- if data:GetRace() ~= PPM2.RACE_PEGASUS and data:GetRace() ~= PPM2.RACE_ALICORN then
- if lastMessage < RealTimeL() then
- lastMessage = RealTimeL() + 1
- PPM2.LChatPrint('info.ppm2.fly.pegasus')
- end
- return
- end
- if not FORCE_ALLOW_FLIGHT:GetBool() and not SUPPRESS_CLIENTSIDE_CHECK:GetBool() then
- local can = hook.Run('PlayerNoClip', self, not data:GetFly()) or hook.Run('PPM2Fly', self, not data:GetFly())
- if not can then
- if lastMessage2 < RealTimeL() then
- lastMessage2 = RealTimeL() + 1
- PPM2.LChatPrint('info.ppm2.fly.cannot', data:GetFly() and 'land' or 'fly')
- end
- return
- end
- end
- RunConsoleCommand('ppm2_fly')
- lastDouble = 0
- return
- end
- lastDouble = RealTimeL() + 0.2
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement