[SOLVED] a_Player:SetNormalMaxSpeed(0)
#5
@DiamondToaster: 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
Reply
Thanks given by:


Messages In This Thread
RE: a_Player:SetNormalMaxSpeed(0) - by NiLSPACE - 11-09-2015, 08:00 PM
RE: a_Player:SetNormalMaxSpeed(0) - by heroldini - 11-09-2015, 08:09 PM
RE: [SOLVED] a_Player:SetNormalMaxSpeed(0) - by xoft - 11-11-2015, 01:01 AM



Users browsing this thread: 1 Guest(s)