Skip to content

Sub-Zero-Interactive/szi_communityservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

szi_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/Sub-Zero-Interactive/szi_communityservice [esx]/szi_communityservice

Manually

Installation

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

How to apply community service.

  • Use the szi_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("szi_communityservice:sendToCommunityService", player, community_services_count)
			menu.close()
		end
	end, function (data2, menu)
		menu.close()
	end)
end

Legal

License

szi_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/.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages