-
29th December 2012, 08:53
#9
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.
-
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
-
Forum Rules