Liberty Unleashed

Scripting => Script Help => Topic started by: Ankit on February 20, 2012, 01:48:29 pm

Title: Bindkey Help
Post by: Ankit on February 20, 2012, 01:48:29 pm
You Know My Fix Command I Want To Make A Bindkey for it example when player drives a vehicle and he wants to repair his vehicle by pressing 2 so how do i make it?
Title: Re: Bindkey Help
Post by: Romop5 on February 20, 2012, 05:47:04 pm
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Functions/Controls/BindKey (http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Functions/Controls/BindKey)
Code: [Select]
function onScriptLoad()
{
     BindKey( '2', BINDTYPE_DOWN, FixCar, 123 );
     
     return 1;
}
 
function FixCar( id )
{
     Message( "You fixed car with ID " + somenumber );
}
Title: Re: Bindkey Help
Post by: Ankit on February 21, 2012, 03:32:18 am
you could just say "i want to copy svenko's server :P"


dude i tried adding it from your useful scripts but i am not doing it correctly so i want to do it seperatly
 :P
Title: Re: Bindkey Help
Post by: Ankit on February 21, 2012, 03:40:33 am
i dont have any binds or binds_client.nut so do i have to create them ,copy then paste and save them
when i run server go in i spawn /infernus when my car is damaged i press U nothing happens
Title: Re: Bindkey Help
Post by: Ankit on February 21, 2012, 11:00:43 am
i tried everything you told me i added it but after when i go in my server and press u in car to fix the damage nothing happens why?
Title: Re: Bindkey Help
Post by: Thijn on February 21, 2012, 12:44:39 pm
I guess you haven't read Svenko's reply good enough.
1. Did you add both binds.net and binds_client.nut in the same folder as the rest of your scripts.
2. Did you add the <script file="binds.nut" client="0"> lines to you script.xml?
3. Does the rest of the script actually load? You can try putting a print into the onScriptLoad function.

Good luck.
Title: Re: Bindkey Help
Post by: Ankit on February 21, 2012, 02:06:26 pm
Quote
Does the rest of the script actually load? You can try putting a print into the onScriptLoad function.
i tried adding print to it , it doesnt loads so what did i do wrong?
Title: Re: Bindkey Help
Post by: Thijn on February 22, 2012, 12:53:44 pm
Then you forgot to add them to your script.xml, or added them wrongly.
Title: Re: Bindkey Help
Post by: Ankit on February 23, 2012, 05:34:59 am
i didnt forgot even a word
Title: Re: Bindkey Help
Post by: Hatser on August 07, 2012, 07:44:33 pm
you need to put it in folder named binds and add
<script folder="binds"/>
to your content.xml