Jump to content

[Help] BubbleChat Exported Function


Looktovask

Recommended Posts

*- v1.2.2: Added export function: outputMessage (server-side)
. Syntax: outputMessage(element, message)
. -element: the element who send the message
. -message: the message that will be shown

 

how i can use this?

 

i tried this way:
 

outputMessage(player, "mensagem")

exports.bubblechat:outputMessage(player, "mensagem")

 

the code is client sided

 

Link to comment
*- v1.2.2: Added export function: outputMessage (server-side) 

The created function is server-side.

You are trying in client-side.

 

If you want to use client-side, you need use trigger or search what functions does the bubble in client-side. In your case is 

addBubble and removeBubble

 

 

Edited by Furzy
  • Thanks 1
Link to comment

addBubble( player, "Olá, deseja comprar esse imovel ?")

this way?

function onClientMarkerHit(player, mdim )
    if player == getLocalPlayer() then
        if mdim then
            local veh = getPedOccupiedVehicle(player)
            local state = getElementData(player,"Консультант_работает")
            if getElementData(source,"Консультант_маркер_пациент") then
                if not veh then
                    setElementFrozen(player,true)
                    setPedAnimation(player,"GANGS","prtial_gngtlkC",8000,false,true,true,false)
                    setElementData(player,"Консультант_машина_пациент",tonumber(getElementData(player,"Консультант_машина_пациент")) + 1)
                    
                    addBubble("Olá, deseja comprar esse imovel ?")
                    setTimer(function()
                    	addBubble(ped ,"Provavelmente, gostei bastante.")
                        setTimer(function()
                        	addBubble(player ,"Este imovel é um otimo negocio, você vai adorar.")
                            setTimer(function()
                            	addBubble(player ,"local é maravilhoso e bem tranquilo.")
                                setTimer(function()
                                    local fix = math.random(1,2)
                                    if fix == 1 then 
                                    	addBubble(ped ,"Preciso pensar um pouco e ver outras opções.")
                                        setTimer(function()
                                            if isElement(player) and getElementData(player,"Консультант_работает") then
                                                deleteMarkerConsultant(player)
                                                setElementFrozen(player,false)
                                                createMarkerConsultant(player)
                                                exports._infobox:addNotification("A casa não foi vendida você receberá uma porcentagem pela tentativa: "..getElementData(player,"Заработано_Всего_Кон").."", "info")
 											end
                                        end,500,1)
                                    elseif fix == 2 then
                                    	addBubble(ped ,"Ok irei até sua loja para fechar o negocio.")
                                        setTimer(function()
                                            if isElement(player) and getElementData(player,"Консультант_работает") then
                                            local pacienty = tonumber(getElementData(player,"Консультант_машина_пациент"))
                                                if pacienty > 0 then
                                                    setElementData(player,"Консультант_работает",tonumber(state) + pacienty)
                                                    setElementData(player,"Консультант_машина_пациент",0)
                                                    if not getElementData(player,"Заработано_Всего_Кон") then
                                                        setElementData(player,"Заработано_Всего_Кон",0)
                                                    end
                                                    if not getElementData(player,"Заработано_Сейчас_Кон") then setElementData(player,"Заработано_Сейчас_Кон",0) end
                                                    setElementData(player,"Заработано_Всего_Кон",getElementData(player,"Заработано_Всего_Кон") + getElementData(player,"Заработано_Сейчас_Кон"))
                                                    deleteMarkerConsultant(player)
                                                    setElementFrozen(player,false)
                                                    createMarkerConsultant(player)
                                                    exports._infobox:addNotification("Casa vendida com sucesso. Sua comissão : "..getElementData(player,"Заработано_Сейчас_Кон").."", "info")
                                                    end
                                            end
                                        end,500,1)
                                    end
                                end,2000,1)
                            end,2000,1)
                        end,2000,1)
                    end,2000,1)
                end
            end
        end
    end
end
addEventHandler("onClientMarkerHit", getRootElement(), onClientMarkerHit )

 

Link to comment

If you are doing it another resource you need to export it.

The syntax is

 addBubble(text, player, tick)

but you can try it 

triggerEvent("onChatIncome", player, "Message")

test it in client-side of bubblechat script, if it works you can export fucntion addBubble or create a function to export it.

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...