Introducing MPGH's AIGA. The latest advancement in artificial intelligence. Click here now to learn more!
Results 1 to 5 of 5
  1. #1
    jellyduck's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    0
    My Mood
    Amazed

    [SOLVED]run function if key press

    Hi!

    I will modify my mod and I think I know how to do except this:
    I want to run a function when a key is down:

    keyPressed()
    {
    if(self isHost())
    {
    //give weapon
    }
    }

    How can I check if the specifik key is pressed?
    And one more question: Can I write something in the chat wich runs the functions and send an argument with?

    Thanks

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,663
    My Mood
    Breezy
    [php]keypressCheck()
    {
    self notifyOnPlayerCommand("N", "+actionslot 1"); //Assigns N to actionslot 1
    for(;
    {
    self waittill("N"): //Waits til someone presses N
    self thread keyPressed(): //Starts the keyPressed() thread
    }
    }
    keyPressed()
    {
    if(self isHost()) //If you are host
    {
    //Do some stuff here
    }
    }[/php]

    If you want to say something through a GSC, use:
    self sayall("YourTextHere");
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. #3
    House's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    2,990
    Reputation
    223
    Thanks
    9,296
    My Mood
    Cynical
    /Marked as Solved

  4. #4
    fakeadmin55's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    in the dirt
    Posts
    18
    Reputation
    10
    Thanks
    0
    My Mood
    Aggressive
    dont forget to self thread in your dovars or onplayerspawned so the script knows the run the thread.

    FUCK STEAM!

  5. #5
    fakeadmin55's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    in the dirt
    Posts
    18
    Reputation
    10
    Thanks
    0
    My Mood
    Aggressive
    i tryed this code and it didnt seem to work

    FUCK STEAM!