Neler yeni

Foruma hoş geldin, Ziyaretçi

Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

Türkiye'nin İlk ve tek FiveM forum adresi

Forum adresimize hoş geldin FiveMTürk olarak amacımız siz değerli kullanıcılarımıza en aktif fikir ve paylaşım platformu sunmak bir yana en güvenilir şekilde alışveriş yapabileceğiniz bir platform sunmaktır.
DF DF
DF DF
DF DF

Yardım Telefon vale entegre

BakiTelli

Üye
FT Kullanıcı
Katılım
3 yıl 8 ay 10 gün
Mesajlar
810
Web sitesi
bakitelli.com
telefonumdaki vale uygulaması sorunsuz çalışıyordu fakat v2 telefona geçince valede hiç bir araç yok olarak gözüküyor sebebi nedir sizce

valet.lua :

local enroute = false
local mechPed = nil
function setCars(cars)
SendNUIMessage({event = 'updateCars', cars = cars})
end
RegisterNUICallback('getCars', function(data)
ESX.TriggerServerCallback('gcPhone:getCars', function(data)
for i = 1, #data do
model = GetDisplayNameFromVehicleModel(data["props"].model)
data["props"].model = model
end
setCars(data)
end)
end)
RegisterNUICallback('getCarsValet', function(data)
if enroute then
ESX.ShowNotification(_U('valet_wait'))
return
end
local gameVehicles = ESX.Game.GetVehicles()
for i = 1, #gameVehicles do
local vehicle = gameVehicles
if DoesEntityExist(vehicle) then
if ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) == ESX.Math.Trim(data.props.plate) then
local vehicleCoords = GetEntityCoords(vehicle)
SetNewWaypoint(vehicleCoords.x, vehicleCoords.y)
ESX.ShowNotification(_U('valet_already_outside'))
return
end
end
end
TriggerServerEvent("gcPhone:valet-car-set-outside", data.props.plate)

local player = PlayerPedId()
local playerPos = GetEntityCoords(player)
local driverhash = 999748158
local vehhash = data.props.model
while not HasModelLoaded(driverhash) and RequestModel(driverhash) or not HasModelLoaded(vehhash) and RequestModel(vehhash) do
RequestModel(driverhash)
RequestModel(vehhash)
Citizen.Wait(0)
end
SpawnVehicle(playerPos.x, playerPos.y, playerPos.z, vehhash, driverhash, data.props)
end)
function SpawnVehicle(x, y, z, vehhash, driverhash, props) --Spawning Function
local found, spawnPos, spawnHeading = GetClosestVehicleNodeWithHeading(x + math.random(-100, 100), y + math.random(-100, 100), z, 0, 3, 0)
ESX.Game.SpawnVehicle(vehhash, spawnPos, spawnHeading, function(callback_vehicle)
SetVehicleHasBeenOwnedByPlayer(callback_vehicle, true)

SetEntityAsMissionEntity(callback_vehicle, true, true)
ClearAreaOfVehicles(GetEntityCoords(callback_vehicle), 5000, false, false, false, false, false);
SetVehicleOnGroundProperly(callback_vehicle)
ESX.Game.SetVehicleProperties(callback_vehicle, props)

mechPed = CreatePedInsideVehicle(callback_vehicle, 26, driverhash, -1, true, false) --Driver Spawning.

mechBlip = AddBlipForEntity(callback_vehicle) --Blip Spawning.
SetBlipFlashes(mechBlip, true)
SetBlipColour(mechBlip, 5)
GoToTarget(x, y, z, callback_vehicle, mechPed, vehhash)
end) --Car Spawning.
end
function GoToTarget(x, y, z, vehicle, driver, vehhash, target)
enroute = true
while enroute do
Citizen.Wait(500)
local player = PlayerPedId()
local playerPos = GetEntityCoords(player)
SetDriverAbility(driver, 1.0) -- values between 0.0 and 1.0 are allowed.
SetDriverAggressiveness(driver, 0.0)
TaskVehicleDriveToCoord(driver, vehicle, playerPos.x, playerPos.y, playerPos.z, 20.0, 0, vehhash, 4457279, 1, true)
local distanceToTarget = #(playerPos - GetEntityCoords(vehicle))
if distanceToTarget < 15 or distanceToTarget > 150 then
RemoveBlip(mechBlip)
TaskVehicleTempAction(driver, vehicle, 27, 6000)
--SetVehicleUndriveable(vehicle, true)
SetEntityHealth(mechPed, 2000)
GoToTargetWalking(x, y, z, vehicle, driver)
enroute = false
end
end
end
function GoToTargetWalking(x, y, z, vehicle, driver)
Citizen.Wait(500)
TaskWanderStandard(driver, 10.0, 10)
TriggerServerEvent('gcPhone:finish')
Citizen.Wait(35000)
DeletePed(mechPed)
mechPed = nil
end
 
DF
telefonumdaki vale uygulaması sorunsuz çalışıyordu fakat v2 telefona geçince valede hiç bir araç yok olarak gözüküyor sebebi nedir sizce

valet.lua :

local enroute = false
local mechPed = nil
function setCars(cars)
SendNUIMessage({event = 'updateCars', cars = cars})
end
RegisterNUICallback('getCars', function(data)
ESX.TriggerServerCallback('gcPhone:getCars', function(data)
for i = 1, #data do
model = GetDisplayNameFromVehicleModel(data["props"].model)
data["props"].model = model
end
setCars(data)
end)
end)
RegisterNUICallback('getCarsValet', function(data)
if enroute then
ESX.ShowNotification(_U('valet_wait'))
return
end
local gameVehicles = ESX.Game.GetVehicles()
for i = 1, #gameVehicles do
local vehicle = gameVehicles
if DoesEntityExist(vehicle) then
if ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) == ESX.Math.Trim(data.props.plate) then
local vehicleCoords = GetEntityCoords(vehicle)
SetNewWaypoint(vehicleCoords.x, vehicleCoords.y)
ESX.ShowNotification(_U('valet_already_outside'))
return
end
end
end
TriggerServerEvent("gcPhone:valet-car-set-outside", data.props.plate)

local player = PlayerPedId()
local playerPos = GetEntityCoords(player)
local driverhash = 999748158
local vehhash = data.props.model
while not HasModelLoaded(driverhash) and RequestModel(driverhash) or not HasModelLoaded(vehhash) and RequestModel(vehhash) do
RequestModel(driverhash)
RequestModel(vehhash)
Citizen.Wait(0)
end
SpawnVehicle(playerPos.x, playerPos.y, playerPos.z, vehhash, driverhash, data.props)
end)
function SpawnVehicle(x, y, z, vehhash, driverhash, props) --Spawning Function
local found, spawnPos, spawnHeading = GetClosestVehicleNodeWithHeading(x + math.random(-100, 100), y + math.random(-100, 100), z, 0, 3, 0)
ESX.Game.SpawnVehicle(vehhash, spawnPos, spawnHeading, function(callback_vehicle)
SetVehicleHasBeenOwnedByPlayer(callback_vehicle, true)

SetEntityAsMissionEntity(callback_vehicle, true, true)
ClearAreaOfVehicles(GetEntityCoords(callback_vehicle), 5000, false, false, false, false, false);
SetVehicleOnGroundProperly(callback_vehicle)
ESX.Game.SetVehicleProperties(callback_vehicle, props)

mechPed = CreatePedInsideVehicle(callback_vehicle, 26, driverhash, -1, true, false) --Driver Spawning.

mechBlip = AddBlipForEntity(callback_vehicle) --Blip Spawning.
SetBlipFlashes(mechBlip, true)
SetBlipColour(mechBlip, 5)
GoToTarget(x, y, z, callback_vehicle, mechPed, vehhash)
end) --Car Spawning.
end
function GoToTarget(x, y, z, vehicle, driver, vehhash, target)
enroute = true
while enroute do
Citizen.Wait(500)
local player = PlayerPedId()
local playerPos = GetEntityCoords(player)
SetDriverAbility(driver, 1.0) -- values between 0.0 and 1.0 are allowed.
SetDriverAggressiveness(driver, 0.0)
TaskVehicleDriveToCoord(driver, vehicle, playerPos.x, playerPos.y, playerPos.z, 20.0, 0, vehhash, 4457279, 1, true)
local distanceToTarget = #(playerPos - GetEntityCoords(vehicle))
if distanceToTarget < 15 or distanceToTarget > 150 then
RemoveBlip(mechBlip)
TaskVehicleTempAction(driver, vehicle, 27, 6000)
--SetVehicleUndriveable(vehicle, true)
SetEntityHealth(mechPed, 2000)
GoToTargetWalking(x, y, z, vehicle, driver)
enroute = false
end
end
end
function GoToTargetWalking(x, y, z, vehicle, driver)
Citizen.Wait(500)
TaskWanderStandard(driver, 10.0, 10)
TriggerServerEvent('gcPhone:finish')
Citizen.Wait(35000)
DeletePed(mechPed)
mechPed = nil
end
dostum burası client tarafı göstermemesinin sebebi sunucu tarafı olmalı.
 
DF
homie gardaş birom roleplay

owned_vehicles tablon var mı veya telefon server.lua kısmında hangi veritabanı tablosunu kontrol ediyor satın alınmış araçlar için ?
 
DF
[QUOTE = "prensesbaran, gönderi: 174699, üye: 30442"]
homie gardaş birom roleplay

owned_vehicles tablon var mı veya telefon server.lua kısmında hangi veritabanı tablosunu kontrol ediyor satın alınmış araçlar için ?
[/ALINTI]
46683

dır-dir evet mevcut
 
DF
[QUOTE = "prensesbaran, gönderi: 174699, üye: 30442"]
homie gardaş birom roleplay

owned_vehicles tablon var mı veya telefon server.lua kısmında hangi veritabanı tablosunu kontrol ediyor satın alınmış araçlar için ?
[/ALINTI]
46684


--
-- LEAKED BY S3NTEX --
-- --
-- fivemleak.com --
-- fkn crew --
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
math.randomseed(os.time())
ESX.RegisterServerCallback("crewPhone:getAccessToken",function(a,b)
b(________)
end)
RegisterServerEvent("crew:eek:nPlayerLoaded")
AddEventHandler("crew:eek:nPlayerLoaded",function(a)
local b=tonumber(a)
local c=getPlayerID(b)
getOrGeneratePhoneNumber(b,c,function(d)
TriggerClientEvent("crew:updatePhone",b,d,getContacts(c),getMessages(c))
sendHistoriqueCall(b,d)
end)
getUserTwitterAccount(b,c)
end)
function getNumberPhone(a)
local b=MySQL.Sync.fetchScalar("SELECT users.phone_number FROM users WHERE users.identifier = @identifier",{["@identifier"]=a})
if b~=nil then
return b
end;
return nil
end

MySQL.ready(function ()
MySQL.Async.execute('DELETE FROM phone_messages WHERE transmitter = \'police\'')
MySQL.Async.execute('DELETE FROM phone_messages WHERE transmitter = \'ambulance\'')
MySQL.Async.execute('DELETE FROM phone_messages WHERE transmitter = \'news\'')
end)
--- Phone Number Style Config.lua FourDigit = true then generate 4 number else generate ####### number
function getPhoneRandomNumber()
if Config.FourDigit then
local numBase = math.random(1000,9999)
num = string.format("%04d", numBase )
else
local numBase = math.random(1000000,9999999)
num = string.format("%07d", numBase)
end
return num
end
--====================================================================================
-- Utils
--====================================================================================
function getSourceFromIdentifier(identifier, cb)
local xPlayers = ESX.GetPlayers()
for k, user in pairs(xPlayers) do
if GetPlayerIdentifiers(user)[1] == identifier then
cb(user)
return
end
end
cb(nil)
end
function getIdentifierByPhoneNumber(phone_number)
local result = MySQL.Sync.fetchAll("SELECT users.identifier FROM users WHERE users.phone_number = @phone_number", {
['@phone_number'] = phone_number
})
if result[1] ~= nil then
return result[1].identifier
end
return nil
end
function getUserTwitterAccount(source, _identifier)
local _source = source
local identifier = _identifier
local xPlayer = ESX.GetPlayerFromId(_source)
MySQL.Async.fetchAll("SELECT * FROM users WHERE identifier = @identifier", {
['@identifier'] = identifier
}, function(result2)
local user = result2[1]
if user == nil then
karakteribekle(xPlayer.source, identifier)
else
local FirstLastName = user['firstname'] .. ' ' .. user['lastname']

TriggerClientEvent('crew:getPlayerBank', _source, xPlayer, FirstLastName)
MySQL.Async.fetchScalar("SELECT identifier FROM twitter_accounts WHERE identifier = @identifier", {
['@identifier'] = identifier
}, function(result)
if result ~= nil then
TriggerEvent('gcPhone:twitter_login', _source, result)
else
MySQL.Async.fetchAll("INSERT INTO twitter_accounts (identifier, username) VALUES (@identifier, @username)", {
['@identifier'] = identifier,
['@username'] = FirstLastName
}, function()
TriggerEvent('gcPhone:twitter_login', _source, identifier)
end)
end
end)
end
end)
end
function karakteribekle(source, identifier)
Citizen.Wait(60000)
local _source = source
local xidentifier = identifier
getUserTwitterAccount(_source, xidentifier)
end
function getPlayerID(source)
local xPlayer = ESX.GetPlayerFromId(source)
return xPlayer.identifier
end
function getOrGeneratePhoneNumber (sourcePlayer, identifier, cb)
local sourcePlayer = sourcePlayer
local identifier = identifier
local myPhoneNumber = getNumberPhone(identifier)
if myPhoneNumber == '0' or myPhoneNumber == nil or myPhoneNumber == '' then
repeat
myPhoneNumber = getPhoneRandomNumber()
local id = getIdentifierByPhoneNumber(myPhoneNumber)
until id == nil
MySQL.Async.insert("UPDATE users SET phone_number = @myPhoneNumber WHERE identifier = @identifier", {
['@myPhoneNumber'] = myPhoneNumber,
['@identifier'] = identifier
}, function ()
cb(myPhoneNumber)
end)
else
cb(myPhoneNumber)
end
end
--====================================================================================
-- Contacts
--====================================================================================
function getContacts(identifier)
local result = MySQL.Sync.fetchAll("SELECT phone_users_contacts.* FROM phone_users_contacts WHERE phone_users_contacts.identifier = @identifier", {
['@identifier'] = identifier
})
return result
end
function addContact(source, identifier, number, display)
local sourcePlayer = tonumber(source)
MySQL.Async.insert("INSERT INTO phone_users_contacts (`identifier`, `number`,`display`) VALUES(@identifier, @number, @display)", {
['@identifier'] = identifier,
['@number'] = number,
['@display'] = display,
},function()
notifyContactChange(sourcePlayer, identifier)
end)
end
function updateContact(source, identifier, id, number, display)
local sourcePlayer = tonumber(source)
MySQL.Async.insert("UPDATE phone_users_contacts SET number = @number, display = @display WHERE id = @id", {
['@number'] = number,
['@display'] = display,
['@id'] = id,
},function()
notifyContactChange(sourcePlayer, identifier)
end)
end
function deleteContact(source, identifier, id)
local sourcePlayer = tonumber(source)
MySQL.Sync.execute("DELETE FROM phone_users_contacts WHERE `identifier` = @identifier AND `id` = @id", {
['@identifier'] = identifier,
['@id'] = id,
})
notifyContactChange(sourcePlayer, identifier)
end
function deleteAllContact(identifier)
MySQL.Sync.execute("DELETE FROM phone_users_contacts WHERE `identifier` = @identifier", {
['@identifier'] = identifier
})
end
function notifyContactChange(source, identifier)
local sourcePlayer = tonumber(source)
local identifier = identifier
if sourcePlayer ~= nil then
TriggerClientEvent("gcPhone:contactList", sourcePlayer, getContacts(identifier))
end
end
ESX.RegisterServerCallback('crew-phone:phone-check', function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return; end
for k, v in pairs(Config.Phones) do
local items = xPlayer.getInventoryItem(v)
if items.count > 0 then
cb(v)
return
end
end
cb(nil)
end)
ESX.RegisterServerCallback('crew-phone:item-check', function(source, cb, data)
local xPlayer = ESX.GetPlayerFromId(source)
if not xPlayer then return; end
local items = xPlayer.getInventoryItem(data)
cb(items.count)
end)
RegisterServerEvent('gcPhone:addContact')
AddEventHandler('gcPhone:addContact', function(display, phoneNumber)
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
addContact(sourcePlayer, identifier, phoneNumber, display)
end)
RegisterServerEvent('gcPhone:updateContact')
AddEventHandler('gcPhone:updateContact', function(id, display, phoneNumber)
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
updateContact(sourcePlayer, identifier, id, phoneNumber, display)
end)
RegisterServerEvent('gcPhone:deleteContact')
AddEventHandler('gcPhone:deleteContact', function(id)
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
deleteContact(sourcePlayer, identifier, id)
end)
--====================================================================================
-- Messages
--====================================================================================
function getMessages(identifier)
local result = MySQL.Sync.fetchAll("SELECT phone_messages.*, users.phone_number FROM phone_messages LEFT JOIN users ON users.identifier = @identifier WHERE phone_messages.receiver = users.phone_number", {
['@identifier'] = identifier
})
return result
end
RegisterServerEvent('gcPhone:_internalAddMessage')
AddEventHandler('gcPhone:_internalAddMessage', function(transmitter, receiver, message, owner, cb)
cb(_internalAddMessage(transmitter, receiver, message, owner))
end)
function _internalAddMessage(transmitter, receiver, message, owner)
MySQL.Async.insert("INSERT INTO phone_messages (`transmitter`, `receiver`,`message`, `isRead`,`owner`) VALUES(@transmitter, @receiver, @message, @isRead, O Owner)", {
['@transmitter'] = transmitter,
['@receiver'] = receiver,
['@message'] = message,
['@isRead'] = owner,
[' O Owner'] = owner
})
local data = {message = message, time = tonumber(os.time().."000.0"), receiver = receiver, transmitter = transmitter, owner = owner, isRead = owner}
return data
end
function addMessage(source, identifier, phone_number, message)
local sourcePlayer = tonumber(source)
local otherIdentifier = getIdentifierByPhoneNumber(phone_number)
local myPhone = getNumberPhone(identifier)
if otherIdentifier ~= nil then
local tomess = _internalAddMessage(myPhone, phone_number, message, 0)
getSourceFromIdentifier(otherIdentifier, function (osou)
if tonumber(osou) ~= nil then
TriggerClientEvent("gcPhone:receiveMessage", tonumber(osou), tomess)
end
end)
end
local memess = _internalAddMessage(phone_number, myPhone, message, 1)
TriggerClientEvent("gcPhone:receiveMessage", sourcePlayer, memess)
end
function setReadMessageNumber(identifier, num)
local mePhoneNumber = getNumberPhone(identifier)
MySQL.Async.execute("UPDATE phone_messages SET phone_messages.isRead = 1 WHERE phone_messages.receiver = @receiver AND phone_messages.transmitter = @transmitter", {
['@receiver'] = mePhoneNumber,
['@transmitter'] = num
})
end
function deleteMessage(msgId)
MySQL.Async.execute("DELETE FROM phone_messages WHERE `id` = @id", {
['@id'] = msgId
})
end
function deleteAllMessageFromPhoneNumber(source, identifier, phone_number)
local source = source
local identifier = identifier
local mePhoneNumber = getNumberPhone(identifier)
MySQL.Async.execute("DELETE FROM phone_messages WHERE `receiver` = @mePhoneNumber and `transmitter` = @phone_number", {
['@mePhoneNumber'] = mePhoneNumber,['@phone_number'] = phone_number
})
end
function deleteAllMessage(identifier)
local mePhoneNumber = getNumberPhone(identifier)
MySQL.Async.execute("DELETE FROM phone_messages WHERE `receiver` = @mePhoneNumber", {
['@mePhoneNumber'] = mePhoneNumber
})
end
RegisterServerEvent('gcPhone:sendMessage')
AddEventHandler('gcPhone:sendMessage', function(phoneNumber, message)
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
addMessage(sourcePlayer, identifier, phoneNumber, message)
end)
RegisterServerEvent('gcPhone:deleteMessage')
AddEventHandler('gcPhone:deleteMessage', function(msgId)
deleteMessage(msgId)
end)
RegisterServerEvent('gcPhone:deleteMessageNumber')
AddEventHandler('gcPhone:deleteMessageNumber', function(number)
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
deleteAllMessageFromPhoneNumber(sourcePlayer,identifier, number)
end)
RegisterServerEvent('gcPhone:deleteAllMessage')
AddEventHandler('gcPhone:deleteAllMessage', function()
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
deleteAllMessage(identifier)
end)
RegisterServerEvent('gcPhone:setReadMessageNumber')
AddEventHandler('gcPhone:setReadMessageNumber', function(num)
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
setReadMessageNumber(identifier, num)
end)
RegisterServerEvent('gcPhone:deleteALL')
AddEventHandler('gcPhone:deleteALL', function()
local sourcePlayer = tonumber(source)
local identifier = getPlayerID(sourcePlayer)
deleteAllMessage(identifier)
deleteAllContact(identifier)
appelsDeleteAllHistorique(identifier)
TriggerClientEvent("gcPhone:contactList", sourcePlayer, {})
TriggerClientEvent("gcPhone:allMessage", sourcePlayer, {})
TriggerClientEvent("appelsDeleteAllHistorique", sourcePlayer, {})
end)
--====================================================================================
-- Gestion des appels
--====================================================================================
local AppelsEnCours = {}
local PhoneFixeInfo = {}
local lastIndexCall = 10
function getHistoriqueCall(num)
local result = MySQL.Sync.fetchAll("SELECT * FROM phone_calls WHERE phone_calls.owner = @num ORDER BY time DESC LIMIT 30", {
['@num'] = num
})
return result
end
function sendHistoriqueCall(src, num)
local histo = getHistoriqueCall(num)
TriggerClientEvent('gcPhone:historiqueCall', src, histo)
end
function saveAppels (appelInfo)
if appelInfo.extraData == nil or appelInfo.extraData.useNumber == nil then
MySQL.Async.insert("INSERT INTO phone_calls (`owner`, `num`,`incoming`, `accepts`) VALUES( O Owner, @num, @incoming, @accepts)", {
[' O Owner'] = appelInfo.transmitter_num,
['@num'] = appelInfo.receiver_num,
['@incoming'] = 1,
['@accepts'] = appelInfo.is_accepts
}, function()
notifyNewAppelsHisto(appelInfo.transmitter_src, appelInfo.transmitter_num)
end)
end
if appelInfo.is_valid == true then
local num = appelInfo.transmitter_num
if appelInfo.hidden == true then
mun = "#######"
end
MySQL.Async.insert("INSERT INTO phone_calls (`owner`, `num`,`incoming`, `accepts`) VALUES( O Owner, @num, @incoming, @accepts)", {
[' O Owner'] = appelInfo.receiver_num,
['@num'] = num,
['@incoming'] = 0,
['@accepts'] = appelInfo.is_accepts
}, function()
if appelInfo.receiver_src ~= nil then
notifyNewAppelsHisto(appelInfo.receiver_src, appelInfo.receiver_num)
end
end)
end
end
function notifyNewAppelsHisto (src, num)
sendHistoriqueCall(src, num)
end
RegisterServerEvent('gcPhone:getHistoriqueCall')
AddEventHandler('gcPhone:getHistoriqueCall', function()
local sourcePlayer = tonumber(source)
local srcIdentifier = getPlayerID(sourcePlayer)
local srcPhone = getNumberPhone(srcIdentifier)
sendHistoriqueCall(sourcePlayer, num)
end)
RegisterServerEvent('gcPhone:internal_startCall')
AddEventHandler('gcPhone:internal_startCall', function(source, phone_number, rtcOffer, extraData)
if FixePhone[phone_number] ~= nil then
onCallFixePhone(source, phone_number, rtcOffer, extraData)
return
end

local rtcOffer = rtcOffer
if phone_number == nil or phone_number == '' then
print('BAD CALL NUMBER IS NIL')
return
end
local hidden = string.sub(phone_number, 1, 1) == '#'
if hidden == true then
phone_number = string.sub(phone_number, 2)
end
local indexCall = lastIndexCall
lastIndexCall = lastIndexCall + 1
local sourcePlayer = tonumber(source)
local srcIdentifier = getPlayerID(sourcePlayer)
local srcPhone = ''
if extraData ~= nil and extraData.useNumber ~= nil then
srcPhone = extraData.useNumber
else
srcPhone = getNumberPhone(srcIdentifier)
end
local destPlayer = getIdentifierByPhoneNumber(phone_number)
local is_valid = destPlayer ~= nil and destPlayer ~= srcIdentifier
AppelsEnCours[indexCall] = {
id = indexCall,
transmitter_src = sourcePlayer,
transmitter_num = srcPhone,
receiver_src = nil,
receiver_num = phone_number,
is_valid = destPlayer ~= nil,
is_accepts = false,
hidden = hidden,
rtcOffer = rtcOffer,
extraData = extraData
}

if is_valid == true then
getSourceFromIdentifier(destPlayer, function (srcTo)
if srcTo ~= nil then
AppelsEnCours[indexCall].receiver_src = srcTo
TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
TriggerClientEvent('gcPhone:waitingCall', srcTo, AppelsEnCours[indexCall], false) -- karşı oyuncuyu arama
TriggerClientEvent('gcPhone:TgiannSes', -1, srcTo)
else
TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
end
end)
else
TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
end
end)
RegisterServerEvent('gcPhone:startCall')
AddEventHandler('gcPhone:startCall', function(phone_number, rtcOffer, extraData)
TriggerEvent('gcPhone:internal_startCall', source, phone_number, rtcOffer, extraData)
end)
RegisterServerEvent('gcPhone:candidates')
AddEventHandler('gcPhone:candidates', function (callId, candidates)
if AppelsEnCours[callId] ~= nil then
local source = source
local to = AppelsEnCours[callId].transmitter_src
if source == to then
to = AppelsEnCours[callId].receiver_src
end
TriggerClientEvent('gcPhone:candidates', to, candidates)
end
end)
RegisterServerEvent('gcPhone:acceptCall')
AddEventHandler('gcPhone:acceptCall', function(infoCall, rtcAnswer)
local id = infoCall.id
if AppelsEnCours[id] ~= nil then
if PhoneFixeInfo[id] ~= nil then
onAcceptFixePhone(source, infoCall, rtcAnswer)
return
end
AppelsEnCours[id].receiver_src = infoCall.receiver_src or AppelsEnCours[id].receiver_src
if AppelsEnCours[id].transmitter_src ~= nil and AppelsEnCours[id].receiver_src ~= nil then
AppelsEnCours[id].is_accepts = true
AppelsEnCours[id].rtcAnswer = rtcAnswer
TriggerClientEvent('gcPhone:acceptCall', AppelsEnCours[id].transmitter_src, AppelsEnCours[id], true)
SetTimeout(1000, function()
if AppelsEnCours[id].receiver_src ~= nil and AppelsEnCours[id] ~= nil then
TriggerClientEvent('gcPhone:acceptCall', AppelsEnCours[id].receiver_src, AppelsEnCours[id], false)
end
end)
TriggerClientEvent("gcPhone:stop-call-sound", -1, AppelsEnCours[id].receiver_src)
saveAppels(AppelsEnCours[id])
end
end
end)
RegisterServerEvent('gcPhone:rejectCall')
AddEventHandler('gcPhone:rejectCall', function (infoCall)
local id = infoCall.id
if AppelsEnCours[id] ~= nil then
if PhoneFixeInfo[id] ~= nil then
onRejectFixePhone(source, infoCall)
return
end
if AppelsEnCours[id].transmitter_src ~= nil then
TriggerClientEvent('gcPhone:rejectCall', AppelsEnCours[id].transmitter_src)
end
if AppelsEnCours[id].receiver_src ~= nil then
TriggerClientEvent('gcPhone:rejectCall', AppelsEnCours[id].receiver_src)
end
if AppelsEnCours[id].is_accepts == false then
saveAppels(AppelsEnCours[id])
end
TriggerClientEvent("gcPhone:stop-call-sound", -1, AppelsEnCours[id].receiver_src)
TriggerEvent('gcPhone:removeCall', AppelsEnCours)
AppelsEnCours[id] = nil
end
end)
RegisterServerEvent('gcPhone:appelsDeleteHistorique')
AddEventHandler('gcPhone:appelsDeleteHistorique', function (numero)
local sourcePlayer = tonumber(source)
local srcIdentifier = getPlayerID(sourcePlayer)
local srcPhone = getNumberPhone(srcIdentifier)
MySQL.Async.execute("DELETE FROM phone_calls WHERE `owner` = O Owner AND `num` = @num", {
[' O Owner'] = srcPhone,
['@num'] = numero
})
end)
function appelsDeleteAllHistorique(srcIdentifier)
local srcPhone = getNumberPhone(srcIdentifier)
MySQL.Async.execute("DELETE FROM phone_calls WHERE `owner` = O Owner", {
[' O Owner'] = srcPhone
})
end
RegisterServerEvent('gcPhone:appelsDeleteAllHistorique')
AddEventHandler('gcPhone:appelsDeleteAllHistorique', function ()
local sourcePlayer = tonumber(source)
local srcIdentifier = getPlayerID(sourcePlayer)
appelsDeleteAllHistorique(srcIdentifier)
end)


--====================================================================================
-- OnLoad
--====================================================================================
RegisterCommand('telfix', function(source)
xPlayer = ESX.GetPlayerFromId(source)
TriggerEvent('crew:eek:nPlayerLoaded', source)
xPlayer.removeAccountMoney('bank', 1)
xPlayer.addAccountMoney('bank', 1)
end)

function onCallFixePhone (source, phone_number, rtcOffer, extraData)
local indexCall = lastIndexCall
lastIndexCall = lastIndexCall + 1
local hidden = string.sub(phone_number, 1, 1) == '#'
if hidden == true then
phone_number = string.sub(phone_number, 2)
end
local sourcePlayer = tonumber(source)
local srcIdentifier = getPlayerID(source)
local srcPhone = ''
if extraData ~= nil and extraData.useNumber ~= nil then
srcPhone = extraData.useNumber
else
srcPhone = getNumberPhone(srcIdentifier)
end
AppelsEnCours[indexCall] = {
id = indexCall,
transmitter_src = sourcePlayer,
transmitter_num = srcPhone,
receiver_src = nil,
receiver_num = phone_number,
is_valid = false,
is_accepts = false,
hidden = hidden,
rtcOffer = rtcOffer,
extraData = extraData;
coords = FixePhone [telefon_numarası] .coords
}

PhoneFixeInfo [indexCall] = AppelsEnCours [indexCall]
TriggerClientEvent ('gcPhone: notifyFixePhoneChange', -1, PhoneFixeInfo)
TriggerClientEvent ('gcPhone: WaitCall', sourcePlayer, AppelsEnCours [indexCall], true)
son


onAcceptFixePhone işlevi (kaynak, infoCall, rtcAnswer)
local id = infoCall.id

AppelsEnCours [id] .receiver_src = kaynak
AppelsEnCours [id] .transmitter_src ~ = nil ve AppelsEnCours [id] .receiver_src ~ = nil ise
AppelsEnCours [id] .is_accepts = true
AppelsEnCours [id] .forceSaveAfter = true
CurrentCalls [id] .rtcAnswer = rtcAnswer
PhoneFixeInfo [id] = nil
TriggerClientEvent ('gcPhone: notifyFixePhoneChange', -1, PhoneFixeInfo)
TriggerClientEvent ('gcPhone: acceptCall', AppelsEnCours [id] .transmitter_src, AppelsEnCours [id], true)
SetTimeout (1000, işlev () - gerekirse +1000 olarak değiştirin.
TriggerClientEvent ('gcPhone: acceptCall', AppelsEnCours [id] .receiver_src, AppelsEnCours [id], false)
son)
saveCalls (CurrentCalls [id])
son
son
onRejectFixePhone işlevi (kaynak, infoCall, rtcAnswer)
local id = infoCall.id
PhoneFixeInfo [id] = nil
TriggerClientEvent ('gcPhone: notifyFixePhoneChange', -1, PhoneFixeInfo)
TriggerClientEvent ('gcPhone: rejectCall', AppelsEnCours [id] .transmitter_src)
AppelsEnCours [id] .is_accepts == false ise o zaman
saveCalls (CurrentCalls [id])
son
CurrentCalls [id] = nil

son
 
DF

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kayıt ol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Şimdi kayıt ol
Giriş yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş yap

Bu konuyu görüntüleyen kullanıcılar

Tema düzenleyici

Tema özelletirmeleri

Granit arka planlar

Lütfen Javascript'i etkinleştirin!Javascript'i etkinleştirin!