Jump to content

outputChatBox Server-Side only for one player ?


Karuzo

Recommended Posts

Posted

So heres me problem :

I've got an outputChatBox Server-Sided and i tried to just output it for the player who enters a vehicle..

Well , i tried it with source, but it didn't worked. everybody has saw the message.

So i've tried it like that :

outputChatBox("TEXT",source,255,69,0) 

I think i could trigger it to the Client . but i think there would be an easier way ?

Posted
  
outputChatBox("TEXT",thePlayer,255,69,0) 
  

Try it.

That would only make sense if he defined the player as thePlayer, you should probably stop post-whoring because it's becoming obvious with your copious amount of fails.

@OP post the whole function and we'll see what do brah.

Posted
addEventHandler("onVehicleEnter",getRootElement(),function ( player,seat) 
    if seat == 0 then 
        triggerClientEvent("ChatMessage",getRootElement()) 
        local enginestate = getElementData(source,"engine") 
        if not enginestate then 
        setElementData(source,"engine",false) 
        enginestate = false 
        end 
        if enginestate == false then 
        setVehicleEngineState(source,false) 
        end 
        bindKey(player,"l","down",light_func,player) 
        bindKey(player,"x","down",motor_func,player) 
    end 
end) 
  

  • Moderators
Posted

As you can see player is already defined, in the parameters.

outputChatBox("TEXT",player,255,69,0) 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...