Skip to content

Commit 1bee62f

Browse files
committed
Ace permissions
1 parent 8040d8e commit 1bee62f

File tree

5 files changed

+95
-0
lines changed

5 files changed

+95
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
2+
3+
client_script "client.lua"
4+
5+
server_script "server.lua"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
RegisterCommand("announce", function(source, args)
2+
TriggerServerEvent("announce", table.concat(args, " "))
3+
end)
4+
5+
-- This interacts with the server script (as the chat message if only for the client ONLY)
6+
RegisterNetEvent("no-perms")
7+
AddEventHandler("no-perms", function()
8+
TriggerEvent("chatMessage", "[Error]", {255,0,0}, "Sorry, but you don't have permission to do this" )
9+
end)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
add_ace Admin administrator allow
2+
3+
#You can find your steam id (hex) at https://vacbanned.com
4+
add_principal identifier.steam:110000110ba80e2 Admin
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# You probably don't want to change these!
2+
# Only change them if you're using a server with multiple network interfaces.
3+
endpoint_add_tcp "0.0.0.0:30120"
4+
endpoint_add_udp "0.0.0.0:30120"
5+
6+
# These resources will start from the resources.cfg
7+
exec resources.cfg
8+
9+
# This allows players to use scripthook based plugins such as lambda menu.
10+
# Set this to 0 to disallow scripthook.
11+
sv_scriptHookAllowed 0
12+
13+
# Uncomment this to enable RCON. Make sure to change the password.
14+
#rcon_password changeme
15+
16+
# A comma-separated list of tags for your server.
17+
# For example:
18+
# - sets tags "drifting, cars, racing"
19+
# Or:
20+
# - sets tags "roleplay, military, tanks"
21+
sets tags "jeva, tutorial"
22+
23+
# Set an optional server info and connecting banner image url.
24+
# Size doesn't matter, any banner sized image will be fine.
25+
#sets banner_detail "http://url.to/image.png"
26+
#sets banner_connecting "http://url.to/image.png"
27+
28+
sets banner_detail "http://thatziv.ddns.net/zgradient.png"
29+
sets banner_connecting "http://thatziv.ddns.net/zabstract.png"
30+
31+
# Set your server's hostname
32+
sv_hostname "Jeva Tutorial"
33+
34+
# Nested configs!
35+
#exec server_internal.cfg
36+
37+
# Loading a server icon (96x96 PNG file)
38+
load_server_icon 96.png
39+
40+
# convars which can be used in scripts
41+
set temp_convar "hey world!"
42+
43+
# Uncomment this line if you do not want your server to be listed in the server browser.
44+
#sv_master1 ""
45+
46+
# Want to only allow players authenticated with a third-party provider like Steam?
47+
# Don't forget Social Club is a third party provider too!
48+
#sv_authMaxVariance 1
49+
#sv_authMinTrust 5
50+
51+
# runs the new permissons that we added
52+
exec perms.cfg
53+
54+
# Add system admins
55+
add_ace group.admin command allow # allow all commands
56+
add_ace group.admin command.quit deny # but don't allow quit
57+
add_principal identifier.steam:110000110ba80e2 group.admin # add the admin to the group
58+
59+
# Hide player endpoints in external log output.
60+
sv_endpointprivacy true
61+
62+
# Server player slot limit (must be between 1 and 32)
63+
sv_maxclients 32
64+
65+
# License key for your server (https://keymaster.fivem.net)
66+
exec license.cfg
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
RegisterServerEvent("announce")
2+
AddEventHandler("announce", function(param)
3+
-- Checks if the player's steam ID is equal to the principle we added in perms.cfg
4+
if IsPlayerAceAllowed(source, "administrator") then
5+
print("^7[^1Announcement^7]^5:" .. param)
6+
TriggerClientEvent("chatMessage", -1, "^7[^1Announcement^7]^2", {0,0,0}, param)
7+
else
8+
-- [Error handler] This triggers the event we registered in the client (due to the error message ONLY for the single client)
9+
TriggerClientEvent("no-perms", source)
10+
end
11+
end)

0 commit comments

Comments
 (0)