2022-07-16 04:46:27 +02:00
|
|
|
-- For support join my discord: https://discord.gg/Z9Mxu72zZ6
|
|
|
|
|
|
|
|
|
|
NDCore = {}
|
2022-07-16 00:12:02 -04:00
|
|
|
NDCore.SelectedCharacter = nil
|
2022-07-17 19:34:17 +02:00
|
|
|
NDCore.Characters = {}
|
2022-07-16 00:12:02 -04:00
|
|
|
NDCore.Functions = {}
|
|
|
|
|
NDCore.Config = config
|
2022-07-16 04:46:27 +02:00
|
|
|
|
|
|
|
|
function GetCoreObject()
|
|
|
|
|
return NDCore
|
|
|
|
|
end
|
|
|
|
|
|
2022-07-16 00:12:02 -04:00
|
|
|
function NDCore.Functions.GetSelectedCharacter(cb)
|
|
|
|
|
if not cb then return NDCore.SelectedCharacter end
|
|
|
|
|
cb(NDCore.SelectedCharacter)
|
2022-07-16 04:46:27 +02:00
|
|
|
end
|
|
|
|
|
|
2022-07-16 00:12:02 -04:00
|
|
|
function NDCore.Functions.GetCharacters(cb)
|
2022-07-17 19:34:17 +02:00
|
|
|
if not cb then return NDCore.Characters end
|
|
|
|
|
cb(NDCore.Characters)
|
2022-07-16 04:46:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- discord rich precense will show on a users profile.
|
2022-09-16 15:19:12 +02:00
|
|
|
if config.enableRichPresence then
|
2022-07-16 04:46:27 +02:00
|
|
|
Citizen.CreateThread(function()
|
|
|
|
|
while true do
|
2022-07-16 00:12:02 -04:00
|
|
|
if NDCore.SelectedCharacter then
|
2022-07-18 20:33:39 +02:00
|
|
|
SetDiscordAppId(config.appId)
|
2022-07-16 00:12:02 -04:00
|
|
|
SetRichPresence(" Playing : " .. config.serverName .. " as " .. NDCore.SelectedCharacter.firstName .. " " .. NDCore.SelectedCharacter.lastName)
|
2022-07-16 04:46:27 +02:00
|
|
|
SetDiscordRichPresenceAsset(config.largeLogo)
|
|
|
|
|
SetDiscordRichPresenceAssetText("Playing: " .. config.serverName)
|
|
|
|
|
SetDiscordRichPresenceAssetSmall(config.smallLogo)
|
2022-07-16 00:12:02 -04:00
|
|
|
SetDiscordRichPresenceAssetSmallText("Playing as: " .. NDCore.SelectedCharacter.firstName .. " " .. NDCore.SelectedCharacter.lastName)
|
2022-07-16 04:46:27 +02:00
|
|
|
SetDiscordRichPresenceAction(0, config.firstButtonName, config.firstButtonLink)
|
|
|
|
|
SetDiscordRichPresenceAction(1, config.secondButtonName, config.secondButtonLink)
|
|
|
|
|
end
|
|
|
|
|
Citizen.Wait(config.updateIntervall * 1000)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- show server name, first name, last name, and the amount of money the character has in the pause menu.
|
|
|
|
|
if config.customPauseMenu then
|
|
|
|
|
Citizen.CreateThread(function()
|
|
|
|
|
while true do
|
|
|
|
|
Citizen.Wait(0)
|
2022-07-16 00:12:02 -04:00
|
|
|
if NDCore.SelectedCharacter then
|
2022-07-16 04:46:27 +02:00
|
|
|
if IsPauseMenuActive() then
|
|
|
|
|
BeginScaleformMovieMethodOnFrontendHeader("SET_HEADING_DETAILS")
|
|
|
|
|
AddTextEntry("FE_THDR_GTAO", config.serverName)
|
2022-07-16 00:12:02 -04:00
|
|
|
ScaleformMovieMethodAddParamPlayerNameString(NDCore.SelectedCharacter.firstName .. " " .. NDCore.SelectedCharacter.lastName)
|
|
|
|
|
PushScaleformMovieFunctionParameterString("Cash: $" .. tostring(NDCore.SelectedCharacter.cash))
|
|
|
|
|
PushScaleformMovieFunctionParameterString("Bank: $" .. tostring(NDCore.SelectedCharacter.bank))
|
2022-07-16 04:46:27 +02:00
|
|
|
EndScaleformMovieMethod()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Enables pvp if it's selected in the config.
|
|
|
|
|
AddEventHandler("playerSpawned", function()
|
|
|
|
|
if config.enablePVP then
|
|
|
|
|
SetCanAttackFriendly(PlayerPedId(), true, false)
|
|
|
|
|
NetworkSetFriendlyFireOption(true)
|
|
|
|
|
end
|
|
|
|
|
print("^0This framework is created by ^5Andyyy#7666 ^0for support you can join the ^5discord: ^0https://discord.gg/Z9Mxu72zZ6")
|
2022-09-16 15:19:12 +02:00
|
|
|
end)
|