Jump to content

Help with script. control off


MitnickP56

Recommended Posts

Hi. I'm trying to do script while which block control HORN from other keys than ( H // CAPSLOCK)

Code server:

function klakson (source)
  if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h"))  then
  setControlState (source, "horn", true )
    outputChatBox ("on",getRootElement(),255,0,0,true) -- only information
    else
     toggleControl ( "horn", false )
    outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information
  end
end
addEventHandler ("onClientResourceStart",getRootElement(),klakson)

 

Any ideas? ;/

 

 

 

Link to comment

Try this:

function klakson ()
  if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h"))  then
  setControlState (source, "horn", true )
    outputChatBox ("on",getRootElement(),255,0,0,true) -- only information
    else
     toggleControl ( "horn", false )
    outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information
  end
end
addEventHandler ("onPlayerJoin",getRootElement(),klakson)

 

Link to comment
55 minutes ago, aka Blue said:

Try this:


function klakson ()
  if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h"))  then
  setControlState (source, "horn", true )
    outputChatBox ("on",getRootElement(),255,0,0,true) -- only information
    else
     toggleControl ( "horn", false )
    outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information
  end
end
addEventHandler ("onPlayerJoin",getRootElement(),klakson)

 

Not working.

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