hi,
i would like to set players walk speed to 0
(players should not walk arround bevor countdown ends...),
but when i use
a_Player:SetNormalMaxSpeed(0), clients camera zooms...
is it a bug or i do something wrong?
[
attachment=663]
thx for answer
That's because Minecraft changes the Field of View (FOV) depending on your speed attribute. Cuberite simply changes it and as a result Minecraft will also change the camera.If you don't want this you can try teleporting the player back once he leaves spot he's in.
ok, thanks...
then its no plugin bug, but rather a feature for now

Pretty much the only thing I could think of in this situation without changing the FoV is using the OnPlayerMoving hook like so:
-- Lets have a table containing names of players that cannot move
StopMove = {}
-- Also, lets assume that their name was already inserted into the table somehow
function OnPlayerMoving(Player)
-- Search through the table as key-value format
for _, k in pairs(StopMoving) do
-- If the player's name happens to match a name in the table, stop them
if Player:GetName() == k then
-- Returning true means that the plugin has handled the player movement itself and the server doesn't have to perform any further actions
return true
end
end
end
: You're using an inefficient way to do this. Reorganize your StopMove table to instead be a map of PlayerName -> true for all players that are to be stopped, then it's much better:
--- Map of PlayerName -> true for all players who should not be allowed to move
StopMove = {}
-- Stop a player from moving:
StopMove[a_Player:GetName()] = true
-- Enable player to move again:
StopMove[a_Player:GetName()] = nil
--- The hook handler for HOOK_PLAYER_MOVING, stops specified players from moving:
function OnPlayerMoving(Player)
if (StopMove[Player:GetName()]) then
return true
end
end
Yeah. It's a bit of a bad habit treating them like C++ vectors. :/ Using a map and setting it to nil would definitely be better.