Giter Site home page Giter Site logo

synfyi / esx_communityservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atg-github/esx_communityservice

0.0 0.0 0.0 60 KB

Fivem [ESX] An alternative form of punishment and reformation for criminals with Protected server events.

License: GNU General Public License v3.0

Lua 100.00%

esx_communityservice's Introduction

Security

Tired of hackers putting your players in community service? Install this updated version with protected server events!

ESX_CommunityService

An alternative form of punishment and social correction to jail. With this script, you can now send criminals in the central square, to provide community service by cleaning and gardening. Try to escape it and you will get your service extended!

Requirements

Download & Installation

Using Git

cd resources
git clone https://github.com/ATG-Github/ESX_CommunityService [esx]/esx_communityservice

Manually

Installation

  • Import esx_communityservice.sql in your database
  • Add this in your server.cfg :
start esx_communityservice

How to apply community service.

  • Use the esx_communityservice:sendToCommunityService(target, service_count) server trigger.
  • Use the /comserv player_id service_count command (only admins).
  • Use the /endcomserv player_id to finish a player's community service (only admins).

How to add to policejob menu.

Example in esx_policejob: client/main.lua:

-- ADDITION [1]
{label = _U('fine'),			value = 'fine'},
{label = _U('unpaid_bills'),	value = 'unpaid_bills'},
-- add code below (don't forget to add ',' before new row)
{label = "Community Service",	value = 'communityservice'}


-- ADDITION [2]
elseif action == 'unpaid_bills' then
	OpenUnpaidBillsMenu(closestPlayer)
-- add code below
elseif action == 'communityservice' then
	SendToCommunityService(GetPlayerServerId(closestPlayer))
end


-- ADDITION [3]
-- add this function
function SendToCommunityService(player)
	ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'Community Service Menu', {
		title = "Community Service Menu",
	}, function (data2, menu)
		local community_services_count = tonumber(data2.value)
		
		if community_services_count == nil then
			ESX.ShowNotification('Invalid services count.')
		else
			TriggerServerEvent("esx_communityservice:sendToCommunityService", player, community_services_count)
			menu.close()
		end
	end, function (data2, menu)
		menu.close()
	end)
end

Legal

License

ESX_CommunityService - A community service script for fivem servers.

Copyright (C) 2018-2019 Apostolos Iatridis

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.

esx_communityservice's People

Contributors

apoiat avatar psycodeliccircus avatar dolutattoo avatar synfyi avatar juliiiocesar avatar m7name 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.