02-18-2011, 14:54
(This post was last modified: 02-18-2011, 15:08 by Cyborgking.)
Hello everybody,
I am trying to make something that a function will run when you hit two buttons at once.
First I have tried this:
But that didn't work.
After I tried this:
But that didn't give me a spas either.
So what am I doing wrong?
Thanks
I am trying to make something that a function will run when you hit two buttons at once.
First I have tried this:
Code:
button_watch()
{
self endon("disconnect");
self endon("death");
for(;;)
{
if(self UseButtonPressed() && self MeleeButtonPressed())
{
wait .2;
self giveWeapon( "spas_mp" );
}
}
}
After I tried this:
Code:
button_watch()
{
self endon("disconnect");
self endon("death");
for(;;)
{
if(self UseButtonPressed())
{
wait .2;
if (self.buttonpressed == 1)
{
self giveWeapon( "spas_mp" );
self.buttonpressed = 0;
}
else
{
self.buttonpressed = 3;
}
}
if(self MeleeButtonPressed())
{
wait .2;
if (self.buttonpressed == 3)
{
self giveWeapon( "spas_mp" );
self.buttonpressed = 0;
}
else
{
self.buttonpressed = 1;
}
}
}
}
onPlayerSpawned()
{
for(;;)
{
self.pressedbutton = undefined;
}
}
So what am I doing wrong?
Thanks