To integrate this you need knowledge on development otherwise we don't advise you to try this.
local function displayText(ped, text, yOffset, source) -- I need to pass player source as an extra parameter to display in chat message
local playerPed =PlayerPedId()local playerPos =GetEntityCoords(playerPed)local targetPos =GetEntityCoords(ped)local dist =#(playerPos - targetPos)local los =HasEntityClearLosToEntity(playerPed, ped, 17)if dist <= c.dist and los then peds[ped] = { time =GetGameTimer() + c.time, text = text, yOffset = yOffset }ifnot peds[ped].exists then peds[ped].exists =truelocal playerName =GetPlayerName(GetPlayerFromServerId(source))local messageData = { args = {playerName, text}, tags = {"me"}, playerId = source, channel ='me', }TriggerEvent('chat:addMessage', messageData) Citizen.CreateThread(function()whileGetGameTimer() <= peds[ped].time dolocal pos =GetOffsetFromEntityInWorldCoords(ped, 0.0, 0.0, peds[ped].yOffset)draw3dText(pos, peds[ped].text) Citizen.Wait(0)end peds[ped] =nilend)endendend
Integration For Twitter
In this example I'll show you how to implement for gcphone you can adjust it for your script
first find TwitterPostTweet function in gcphone
To integrate this you need knowledge on development otherwise we don't advise you to try this
functionTwitterPostTweet (username,password,message,sourcePlayer,realUser,cb)getUser(username, password, function (user)if user ==nilthenif sourcePlayer ~=nilthenTwitterShowError(sourcePlayer, 'Twitter Info', 'APP_TWITTER_NOTIF_LOGIN_ERROR')endreturnend MySQL.Async.insert("INSERT INTO twitter_tweets (`authorId`, `message`, `realUser`) VALUES(@authorId, @message, @realUser);", {
['@authorId'] = user.id, ['@message'] = message, ['@realUser'] = realUser }, function (id) MySQL.Async.fetchAll('SELECT * from twitter_tweets WHERE id = @id', { ['@id'] = id }, function (tweets) tweet = tweets[1] tweet['author'] = user.author tweet['authorIcon'] = user.authorIconlocal messageData = { args = {'@'..username, message}, tags = {"twitter"}, channel ='all', }TriggerClientEvent('chat:addMessage', -1, messageData)TriggerClientEvent('gcPhone:twitter_newTweets', -1, tweet)TriggerEvent('gcPhone:twitter_newTweets', tweet)end)end)end)end