Best way to block cheat flying.
#1
Hey,

I want to make people unable to fly unless they have access to creative.
Now i created a piece of code for this.
But when i JUMP down it detects me as flying.
When i fall i don't have this problem.
Also when he does "hover". as i have to allow a range for jumping.
he can fly @ that height as long as he doesnt go up.
I want this to be fixed as well.

I use this piece of code
function OnPlayerMove( Player )
    local World = Player:GetWorld()
    local PlayerPos = Player:GetPosition()
    local Height = World:GetHeight( math.floor(PlayerPos.x), math.floor(PlayerPos.z) )
    
	if( (Player:GetPosY()-4) > Height and Player:GetGameMode() == 0 ) then
        if (playerHeight[Player:GetName()] < Player:GetPosY()) then
		Player:SendMessage( "You\'r not allowed to fly!." )
		Player:TeleportTo( Player:GetPosX(), Height+1, Player:GetPosZ() )
        end
	end
        playerHeight[Player:GetName()] = Player:GetPosY()
end

Is there a better way ?
This is the basic code later the player will be kicked when he tries to often.
Ofcourse when all is fixed.
Reply
Thanks given by:


Messages In This Thread
Best way to block cheat flying. - by ThuGie - 10-24-2012, 12:28 PM
RE: Best way to block cheat flying. - by xoft - 10-24-2012, 07:34 PM
RE: Best way to block cheat flying. - by ThuGie - 10-25-2012, 12:21 AM
RE: Best way to block cheat flying. - by ThuGie - 10-25-2012, 01:39 AM
RE: Best way to block cheat flying. - by xoft - 10-25-2012, 01:52 AM



Users browsing this thread: 1 Guest(s)