-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Terms of Use | ||
|
||
(Below the term "product" is used to describe the script / modification) | ||
|
||
This product is freeware and is not to be exploited for personal, financial or commercial gain. This product is provided without any form of warranty. | ||
Therefore, responsibility for any damages caused by this product or its misuse rest solely with the user, as the author(s) will accept no liability. | ||
|
||
- This copy of terms must remain in its original state and must not be modified in anyway | ||
|
||
- These terms must be alongside the product at all times | ||
|
||
- Do not re-release with out permission (just ask for permission) | ||
|
||
- Do not redistribute to any other sites. This product is only to be published on verified sites by FAXES | ||
|
||
- Editing / abusing these terms will result in action | ||
|
||
- Do not take credit for product. Removing credits from inside the products file(s) is prohibited | ||
|
||
### Summary | ||
So basically you can edit anything with the product (except the terms), but you can not release the product nor release the edited version without written permission from FAXES. | ||
|
||
#### Further Help | ||
http://faxes.zone/discord | ||
|
||
![alt text](http://faxes.zone/TOSlogos/FAXES%20ToUSML.png "FAXES ToU Icon") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
------------------------------------------------ | ||
--- Discord Vehicle Whitelist, Made by FAXES --- | ||
------------------------------------------------ | ||
|
||
resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937" | ||
|
||
client_script "client.lua" | ||
server_script "server.lua" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
------------------------------------------------ | ||
--- Discord Vehicle Whitelist, Made by FAXES --- | ||
------------------------------------------------ | ||
|
||
--- Config --- | ||
|
||
blacklistedVehicles = { | ||
"POLICE", | ||
"POLICE2", | ||
"POLICE3", | ||
} | ||
|
||
--- Code --- | ||
cHavePerms = false | ||
|
||
AddEventHandler('playerSpawned', function() | ||
local src = source | ||
-- print("THIS?") -- DEBUGGING | ||
TriggerServerEvent("FaxDisVeh:CheckPermission", src) | ||
end) | ||
|
||
RegisterNetEvent("FaxDisVeh:CheckPermission:Return") | ||
AddEventHandler("FaxDisVeh:CheckPermission:Return", function(havePerms, error) | ||
-- print("TRIGGERED") -- DEBUGGING | ||
if error then | ||
print("[FAX DISCORD VEHICLE WHITELIST ERROR] No Discord identifier was found! Permissions set to false") | ||
end | ||
|
||
if havePerms then | ||
cHavePerms = true | ||
-- print("true") -- DEBUGGING | ||
else | ||
cHavePerms = false | ||
-- print("false") -- DEBUGGING | ||
end | ||
end) | ||
|
||
Citizen.CreateThread(function() | ||
while true do | ||
Citizen.Wait(500) | ||
|
||
if not cHavePerms then | ||
local ped = PlayerPedId() | ||
local veh = nil | ||
|
||
if IsPedInAnyVehicle(ped, false) then | ||
veh = GetVehiclePedIsUsing(ped) | ||
else | ||
veh = GetVehiclePedIsTryingToEnter(ped) | ||
end | ||
|
||
if veh and DoesEntityExist(veh) then | ||
local model = GetEntityModel(veh) | ||
|
||
for i = 1, #blacklistedVehicles do | ||
local restrictedVehicleModel = GetHashKey(blacklistedVehicles[i]) | ||
if (model == restrictedVehicleModel) then | ||
ShowInfo("~r~Restricted Vehicle Model.") | ||
DeleteEntity(veh) | ||
ClearPedTasksImmediately(ped) | ||
end | ||
end | ||
end | ||
end | ||
-- local src = source | ||
-- TriggerServerEvent("FaxDisVeh:CheckPermission", src) | ||
end | ||
end) | ||
|
||
--- Functions --- | ||
function ShowInfo(text) | ||
SetNotificationTextEntry("STRING") | ||
AddTextComponentSubstringPlayerName(text) | ||
DrawNotification(false, false) | ||
end | ||
function DeleteE(entity) | ||
Citizen.InvokeNative(0xAE3CBE5BF394C9C9, Citizen.PointerValueIntInitialized(entity)) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
------------------------------------------------ | ||
--- Discord Vehicle Whitelist, Made by FAXES --- | ||
------------------------------------------------ | ||
|
||
--- Config --- | ||
|
||
roleNeeded = "ROLE_NAME_HERE" -- Role needed to bypass the Discord vehicle whitelist (be able to use the listed vehicles). | ||
|
||
|
||
--- Code --- | ||
|
||
RegisterServerEvent("FaxDisVeh:CheckPermission") | ||
AddEventHandler("FaxDisVeh:CheckPermission", function(_source) | ||
local src = source | ||
-- print("SERVER TRIG") -- DEBUGGING | ||
for k, v in ipairs(GetPlayerIdentifiers(src)) do | ||
if string.sub(v, 1, string.len("discord:")) == "discord:" then | ||
identifierDiscord = v | ||
end | ||
end | ||
|
||
if identifierDiscord then | ||
if exports.discord_perms:IsRolePresent(src, roleNeeded) then | ||
TriggerClientEvent("FaxDisVeh:CheckPermission:Return", src, true, false) -- They have perms DEV: (perms pass, err pass) | ||
else | ||
TriggerClientEvent("FaxDisVeh:CheckPermission:Return", src, false, false) | ||
end | ||
elseif identifierDiscord == nil then | ||
TriggerClientEvent("FaxDisVeh:CheckPermission:Return", src, false, true) | ||
end | ||
end) |