• ULX: Jail on Disconnect
    3 replies, posted
I'm trying to auto jail anyone who tries to disconnect and rejoins while jailed. Though, it seems as I don't know what I'm doing. ¯\_(ツ)_/¯ I'm having two issues; 1: Script doesn't work. No ERRORS, just doesn't jail on rejoin. 2: I want it to set player position to a specific coordinate, likeSkybox on downtown_v4c_v2.bsp, else Players not involved could get stuck if changing teams, respawning, & joining.. etc, etc. This is Server side. local jailedPlayers = {} hook.Add("PlayerDisconnected", "JailDisconnected", function(ply) if ply.jail then jailedPlayers[ply:SteamID()] = true else jailedPlayers[ply:SteamID()] = nil end end) hook.Add("PlayerInitialSpawn", "JailInitialSpawn", function(ply) if (jailedPlayers[ply:SteamID()]) then RunConsoleCommand( "ulx", "jail", "$" .. ply:SteamID() ) end end) Any help is greatly appreciated. 💖
local jailedPlayers = {} hook.Add("PlayerDisconnected", "JailDisconnected", function(ply) if ply.jail then jailedPlayers[ply:SteamID()] = true else jailedPlayers[ply:SteamID()] = nil end end) local table_jpos = { Vector(0,0,0), Vector(200,300,50), Vector(500,0,100), } hook.Add("PlayerInitialSpawn", "JailInitialSpawn", function(ply) if (jailedPlayers[ply:SteamID()]) then RunConsoleCommand( "ulx", "jail", ply:SteamID() ) ply:SetPos(table.Random(table_jpos)) end end) we dont know how your jail cmd works , give code pls
You need to set pos first and then put player to jail
Where can I put this script?
Sorry, you need to Log In to post a reply to this thread.