Sign in to follow this  
MitnickP56

Help with script. control off

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? ;/

 

 

 

Share this post


Link to post

You should insert that into an OnClientRender and trigger created server events :P

Edited by Simple01

Share this post


Link to post

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)

 

Share this post


Link to post
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.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.