Giter VIP home page Giter VIP logo

esx_jail's Introduction

esx_jail

Let cops jail people!

Features

  • Jail people!
  • Saves jail info to database, aka anti-combat
  • Keeps jail time updated

Installation

  1. Clone the project and add it to your resorces directory
  2. Add the project to your server.cfg
  3. Import esx_jail.sql in your database
  4. Select language in config.lua
  5. (Optional) See below on how to jail via esx_policejob

How to jail

  • Use the esx_jail:sendToJail(source, jailTime) server side trigger
  • Use the /jail playerID jailTime command (only admins)
  • Use the /unjail playerID to unjail a player (only admins)

Requirements

  • ESX
  • skinchanger

Based off

Add to menu

Example in esx_policejob: client/main.lua:

		{label = _U('fine'),			value = 'fine'},
		{label = _U('jail'),			value = 'jail'}
		
		
		if data2.current.value == 'jail' then
			JailPlayer(GetPlayerServerId(closestPlayer))
		end

---

function JailPlayer(player)
	ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_menu', {
		title = _U('jail_menu_info'),
	}, function (data2, menu)
		local jailTime = tonumber(data2.value)
		if jailTime == nil then
			ESX.ShowNotification('invalid number!')
		else
			TriggerServerEvent("esx_jail:sendToJail", player, jailTime * 60)
			menu.close()
		end
	end, function (data2, menu)
		menu.close()
	end)
end

esx_jail's People

Contributors

elpumpo avatar tanguyortegat avatar victor4x avatar rex2630 avatar dux1993 avatar ekennn avatar psycodeliccircus avatar theoriginalpapa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.