Skip to content

Commit 695ea1d

Browse files
authored
Merge pull request #2 from rhys19/version-checker
Version checker
2 parents 1474a4a + 078124a commit 695ea1d

File tree

6 files changed

+70
-8
lines changed

6 files changed

+70
-8
lines changed

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added Discord Permissions
2+
Added Version Checker

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# rolechat
2+
A FiveM plugin
3+
4+
# Dependencies
5+
[FXServer](https://docs.fivem.net/server-manual/setting-up-a-server/) <br>
6+
7+
Latest Server Build <br>
8+
9+
Windows Build:
10+
[Windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/) <br>
11+
Linux Build:
12+
[Linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) <br>
13+
14+
# Installation
15+
1. Download roleschat from my discordperms-version branch!
16+
2. Install it into /resources/<resourceName>
17+
3. setup your aces inside config.lua
18+
4. MAKE SURE YOUR **ACE** PERMISSIONS ARE SETUP CORRECTLY!
19+
5. test out your chat!
20+
6. any issues with the discord perms version must be reported on github issues as i will respond to see if i can fix it ;)
21+
22+
# Credits
23+
* Tazio - Main script creator
24+
* CitizenFX - Making an amazing platform :D

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.3

rolechat/__resource.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
server_script "server.lua"
1+
server_scripts {
2+
"server.lua",
3+
"config.lua"
4+
}

rolechat/config.lua

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Owner = "owner"
2+
Management = "management"
3+
Senior_Admin = "snradmin"
4+
Admin = "admin"
5+
Moderator = "mod"
6+
Tmod = "tmod"

rolechat/server.lua

+33-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
-- add_ace Adminrole taz.admin allow
55
-- add_principal identifier.steam:[hexid] Adminrole
66

7-
local Owner = "taz.owner"
8-
local Management = "taz.management"
9-
local Senior_Admin = "taz.snradmin"
10-
local Admin = "taz.admin"
11-
local Moderator = "taz.mod"
12-
local Tmod = "taz.tmod"
13-
147
AddEventHandler('chatMessage', function(source, Name, Msg)
158
args = stringsplit(Msg, " ")
169
CancelEvent()
@@ -42,3 +35,36 @@ function stringsplit(inputstr, sep)
4235
end
4336
return t
4437
end
38+
39+
40+
-- version checker
41+
local CurrentVersion = '1.3'
42+
local GithubResourceName = 'roleschat'
43+
local githubacct = "Tazi0"
44+
local resourceName = GetCurrentResourceName()
45+
local versionurl = "https://raw.githubusercontent.com/"..githubacct.."/"..GithubResourceName.."/master/VERSION"
46+
local changesurl = "https://raw.githubusercontent.com/"..githubacct.."/"..GithubResourceName.."/master/CHANGES"
47+
48+
PerformHttpRequest(versionurl, function(Error, NewestVersion, Header)
49+
PerformHttpRequest(changesurl, function(Error, Changes, Header)
50+
print('\n')
51+
print('====================================================================')
52+
print('')
53+
print('ChatRoles ('..resourceName..')')
54+
print('')
55+
print('Current Version: ' .. CurrentVersion)
56+
print('Newest Version: ' .. NewestVersion)
57+
print('you can download the newest version at: \n https://github.com/'..githubacct.."/"..GithubResourceName.."/")
58+
io.write("")
59+
print('Changelog: \n' .. Changes)
60+
print('')
61+
if CurrentVersion ~= NewestVersion then
62+
print('====================================================================')
63+
else
64+
print('===================')
65+
print('=== Up to date! ===')
66+
print('===================')
67+
end
68+
print('\n')
69+
end)
70+
end)

0 commit comments

Comments
 (0)