Results 1 to 10 of 11

Thread: Exchange weapons

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Private
    Join Date
    Jul 2012
    Posts
    76
    Thanks
    9
    Thanked 56 Times in 38 Posts
    Hope I'm able to explain what Kungy means in a newbie way.
    You need to add a loop: while() or for(;;)
    a loop is something that does the same thing over and over again
    example:
    seconds = 0;
    while(seconds < 5)
    {
    wait 1;
    seconds += 1;
    }
    This loop counts the seconds and after 5 seconds the loop stops.
    In such a loop you can check, whether the aimedplayer pressed the useButton(that standardly is the 'F' Button)
    if(aimedPlayer useButtonPressed()) //if aimedPlayer pressed the useButton(F-Button) the function exchangeWeapons is called.
    player exchangeWeapons(aimedPlayer);
    you could write a thread exchangeWeapons(player){} where 'self' and 'player' exchange the weapons in.

    This is just an example and I'm pretty sure this won't work the way you want it to work. I just wanted to explain the loop and stuff to you, at least as best as I can.
    Hope this could help you a little, even though I'm not that good at explaining, I'm aware of that.

  2. The Following User Says Thank You to Peterlankton For This Useful Post:

    kung foo man (29th December 2012)

Posting Permissions

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