CodeM
StoreDiscord
  • Welcome To CodeM Documentation
  • General Information
    • ⌨️Register Key Mapping
    • 📥How To Install Resources
    • 🔷Tebex Integration
  • m Series
    • mBossmenu v2
      • Installation
      • Configuration
    • mBilling v2
      • Installation
      • Configuration
    • mFishing Remake
      • Installation
      • Configuration
    • mVehicleshop v2
      • Installation
      • Configuration
    • mTraderjob
      • Installation
      • Configuration
    • mPausemenu v2
      • Installation
      • Configuration
    • mPhone
      • Installation
      • General Config
      • App Configs
        • Maps
        • LS Times
        • Callie
        • S.O.S
        • Wanted
        • Music
        • Yello
        • Bank
        • Vale
      • SQL Setting
    • mMDT AIO
      • Installation
      • Configuration
      • Dispatch
    • mTaxijob Remake
      • Installation
      • Configuration
    • mMultichar Remake
      • Installation
      • Configuration
      • How To ?
    • mTruckerjob
      • Installation
      • Configuration
    • mInventory Remake
      • Installation
      • Configuration
      • Exports & Commands
        • Server Exports
        • Client Exports
        • Commands
      • ⚠️Attention
      • How To ?
    • mStaff Remake
      • Installation
      • Configuration
    • mAdmin Panel
      • Installation
      • Configuration
      • F.A.Q
    • mMinerjob
      • Installation
      • Configuration
    • mTailorjob
      • Installation
      • Configuration
    • mGarbagejob
      • Installation
      • Configuration
    • mBossmenu
      • Installation
      • Configuration
      • How To
    • mLSTransit
      • Installation
      • Configuration
    • mTextUI
      • Installation
      • Event Of Uses
    • mCraft v2
      • Installation
      • Configuration
    • mBank v2
      • Installation
      • Configuration
      • How To
    • mCarcontrol
      • Installation
      • Configuration
    • mScoreboard
      • Installation
      • Configuration
      • How To ?
    • mBilling
      • Installation
      • Configuration
      • Note
      • Exports
    • mMechanic
      • Installation
      • Configuration
      • Attention
    • mTuningchip
      • Installation
      • Configuration
      • Inventory Settings
    • mHunting
      • Installation
      • Configuration
    • mAppearance
      • Installation
      • How To
    • mHUD AIO
      • Installation
      • Configuration
      • How To
    • mSpawn
      • Installation
      • Configuration
      • Integrations
    • mReport
      • Installation
      • Configuration
    • mWeed
      • Installation
      • Configuration
      • How To
    • mBlvckmarkt
      • Installation
      • Configuration
    • mVehicleshop
      • Installation
      • Configuration
      • Adjustment
    • mPostop
      • Installation
      • Configuration
      • Config File
    • mChat
      • Installation
      • Configuration
      • How To
      • Integrations
    • mWeaponshop
      • Installation
      • Adjustments
      • Note
    • mLoadingscreen
      • Installation
      • Adjustments
      • Themes
      • Note
    • mBank
      • Installation
      • Adjustments
      • SQL Installations
    • mGarage
    • mDeathscreen
    • mNotification
    • mPausemenu
  • x Series
    • xBackItems
      • Installation
      • Configuration
      • How To
    • xBossMenu
      • Installation
      • Configuration
    • xRadar
      • Installation
      • Configuration
      • Default Keybinds
    • xRadio
      • Installation
      • Configuration
    • xMarketplace
      • Installation
      • Configuration
    • xPawnshop
      • Installation
      • Configuration
    • xFuel
      • Installation
      • Configuration
      • Exports
    • xCarrent
      • Installation
      • Configuration
    • xJobselector
      • Installation
      • Configuration
    • xDailyrewards
      • Installation
      • Configuration
      • Exports
    • xLabgame
      • Installation
      • Configuration
      • How To Use
    • xSellable Market
      • Installation
      • Configuration
    • xAdminmenu
      • Installation
      • Configuration
  • VENICE
    • Venice HUD v2
Powered by GitBook
On this page
  • Integration For Me Do Script
  • Integration For Twitter
  1. m Series
  2. mChat

Integrations

Custom Integrations For mChat Resource

PreviousHow ToNextmWeaponshop

Last updated 6 months ago

Integration For Me Do Script

In this example I'll show you how to implement for this script you can adjust it for your script

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
        }

        if not peds[ped].exists then
            peds[ped].exists = true
            local playerName = GetPlayerName(GetPlayerFromServerId(source))
            local messageData = {
                args = {playerName, text},
                tags = {"me"},
                playerId = source, 
                channel = 'me', 
            }
            TriggerEvent('chat:addMessage', messageData)
            Citizen.CreateThread(function()
                while GetGameTimer() <= peds[ped].time do
                    local pos = GetOffsetFromEntityInWorldCoords(ped, 0.0, 0.0, peds[ped].yOffset)
                    draw3dText(pos, peds[ped].text)
                    Citizen.Wait(0)
                end

                peds[ped] = nil
            end)
        end
    end
end

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

function TwitterPostTweet (username, password, message, sourcePlayer, realUser, cb)
    getUser(username, password, function (user)
      if user == nil then
        if sourcePlayer ~= nil then
          TwitterShowError(sourcePlayer, 'Twitter Info', 'APP_TWITTER_NOTIF_LOGIN_ERROR')
        end
        return
      end
      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.authorIcon
          local 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
https://github.com/DeffoN0tSt3/3d-me-do/blob/master/client.lua