Results 1 to 3 of 3

Thread: please help with my lil prob...

  1. #1
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default please help with my lil prob...

    ok i need scar to do some thing but only when shift and a are pushed in...
    if (isfunctionkeydown('SHIFT')=true) and
    (iskeydown('a')=true) then

    this is how im doing it but it says mismatch in script on the bottom true
    please help i will be very grateful =)

  2. #2
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)
    Hehe, open a scar window, and then press F1, or go to Help>>Help F1, then press Ctrl + F, and then type isfunctionkeydown in the search box, then press "find" or "next", well, guess what? when you look at the function closely, you will see that a byte is used, not a string, in case someone else will look at this with the similar problem, but is too lazy to look at it, I am posting it now:
    SCAR Code:
    function IsFunctionKeyDown(Key: Byte): Boolean;
    Checks if the given function key is down.
    Meanings of Key:
    0: SHIFT
    1: CONTROL
    2: ALT
    3: LEFT SHIFT
    4: LEFT CONTROL
    5: LEFT ALT
    6: RIGHT SHIFT
    7: RIGHT CONTROL
    8: RIGHT ALT

    So the function has to look like this:
    SCAR Code:
    if IsFunctionKeyDown(0) and IsKeyDown('a') then {...}

    BTW: you don't need the "=true", because by using the "if" statement it is already only accepting it if it returns true, if you ever want it to return false, then it would look like this:
    SCAR Code:
    if (not IsKeyDown('w')) then {...}
    Hope I explained it good enough ^^
    There is nothing right in my left brain and there is nothing left in my right brain.

  3. #3
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you for that
    sorry bout that =P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. GasCheck Prob
    By marre in forum OSR Help
    Replies: 1
    Last Post: 10-23-2007, 11:32 AM
  2. Okay one more prob.
    By Diabloizzle in forum OSR Help
    Replies: 2
    Last Post: 07-10-2007, 07:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •