Files
Elite-Gaming-FiveM/resources/BusinessAds/client.lua
T
2021-12-03 01:19:31 +00:00

493 lines
13 KiB
Lua

RegisterNetEvent("TrafficAlert")
AddEventHandler("TrafficAlert",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncTrafficAlert', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayTrafficAlert')
AddEventHandler('DisplayTrafficAlert',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_LS_TOURIST_BOARD", "CHAR_LS_TOURIST_BOARD", true, 1, "~y~LS Traffic~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("AmmuAd")
AddEventHandler("AmmuAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncAmmuAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayAmmuAd')
AddEventHandler('DisplayAmmuAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_AMMUNATION", "CHAR_AMMUNATION", true, 1, "~y~Ammunation~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("AmmuAd")
AddEventHandler("AmmuAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncAmmuAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayAmmuAd')
AddEventHandler('DisplayAmmuAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_AMMUNATION", "CHAR_AMMUNATION", true, 1, "~y~Ammunation~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("FleecaAd")
AddEventHandler("FleecaAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncFleecaAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayFleecaAd')
AddEventHandler('DisplayFleecaAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_BANK_FLEECA", "CHAR_BANK_FLEECA", true, 1, "~y~Fleeca Bank~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("MBankAd")
AddEventHandler("MBankAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncMBankAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayMBankAd')
AddEventHandler('DisplayMBankAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_BANK_MAZE", "CHAR_BANK_MAZE", true, 1, "~y~Maze Bank~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("LMotorsAd")
AddEventHandler("LMotorsAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncLMotorsAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayLMotorsAd')
AddEventHandler('DisplayLMotorsAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_CARSITE", "CHAR_CARSITE", true, 1, "~y~Legendary Motorsports~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("SAMotorsAd")
AddEventHandler("SAMotorsAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncSAMotorsAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplaySAMotorsAd')
AddEventHandler('DisplaySAMotorsAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_CARSITE2", "CHAR_CARSITE2", true, 1, "~y~San Andreas Motorsports~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("LSCustomsAd")
AddEventHandler("LSCustomsAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncLSCustomsAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayLSCustomsAd')
AddEventHandler('DisplayLSCustomsAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_LS_CUSTOMS", "CHAR_LS_CUSTOMS", true, 1, "~y~LS Customs~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("CabAd")
AddEventHandler("CabAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncCabAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayCabAd')
AddEventHandler('DisplayCabAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_TAXI", "CHAR_TAXI", true, 1, "~y~Downtown Cab Co.~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("FBAd")
AddEventHandler("FBAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncFBAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayFBAd')
AddEventHandler('DisplayFBAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_FACEBOOK", "CHAR_FACEBOOK", true, 1, "~y~Facebook~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("247Ad")
AddEventHandler("247Ad",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('Sync247Ad', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('Display247Ad')
AddEventHandler('Display247Ad',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_PROPERTY_WEED_SHOP", "CHAR_PROPERTY_WEED_SHOP", true, 1, "~y~247 Store~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("YoutubeAd")
AddEventHandler("YoutubeAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncYoutubeAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayYoutubeAd')
AddEventHandler('DisplayYoutubeAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_YOUTUBE", "CHAR_YOUTUBE", true, 1, "~y~Youtube~s~", "");
DrawNotification(false, true);
end)
RegisterNetEvent("MilitaryAd")
AddEventHandler("MilitaryAd",function()
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
local input = true
Citizen.CreateThread(function()
while input do
if input == true then
HideHudAndRadarThisFrame()
if UpdateOnscreenKeyboard() == 3 then
input = false
elseif UpdateOnscreenKeyboard() == 1 then
local inputText = GetOnscreenKeyboardResult()
if string.len(inputText) > 0 then
TriggerServerEvent('SyncMilitaryAd', inputText)
input = false
else
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 150)
end
elseif UpdateOnscreenKeyboard() == 2 then
input = false
end
end
Citizen.Wait(0)
end
end)
end)
RegisterNetEvent('DisplayMilitaryAd')
AddEventHandler('DisplayMilitaryAd',function(inputText)
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_MP_MERRYWEATHER", "CHAR_MP_MERRYWEATHER", true, 1, "~y~SA Military~s~", "");
DrawNotification(false, true);
end)