Jump to content

Help, please!


Hugos

Recommended Posts

Posted (edited)

Help.

When you click on the start Server-trigger >> account is checked >> the lrient trigger is started >> the function is triggered >> the line is displayed, but it is not displayed for the player who pressed the button, but for all players. Here's the code:

Server:
triggerClientEvent("error", root)

Client:
addEvent("error", true)
function error()
    addEventHandler("onClientRender", root, redline)
end

function redline()
    dxDrawLine(448, 435, 917, 435, tocolor(240, 75, 90), 2, true)
end

How to make something appear only for the player who pressed the button?
 

Edited by Hugos
Posted
13 minutes ago, IIYAMA said:

oh really, that is so amazing! :thumbup:

  


addCommandHandler("hey", 
function (player)
	triggerClientEvent(player, "error", root)
end)

 


addEvent("error", true)
function showError()
    addEventHandler("onClientRender", root, redline)
end
addEventHandler("error", root, showError)

  

What is it? addCommandHandler - why I need?

  • Moderators
Posted
Just now, Hugos said:

What is it? addCommandHandler - why I need?

To define the player element, which receives the message.

command: /hey

 

So yes you don't need the addCommandHandler, if you have an alternative to define the player.

 

Posted
14 minutes ago, IIYAMA said:

To define the player element, which receives the message.

command: /hey

 

So yes you don't need the addCommandHandler, if you have an alternative to define the player.

  

 

Thank you, I got it. 

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