HELP: Using the mouse to trigger events ?

Posted By: dracula

HELP: Using the mouse to trigger events ? - 07/24/08 16:49

In C Sript I have:

while (my.health > 0)
{
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (my, vector(20 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);
if (mouse_left == on) // if the player presses the left mouse button
{
wait(-0.1);
fire_bullets(); // call this function
}


If I replace if(mouse_left == on) with if(mouse_left)

as the manual suggests, my function, fire_bullets() doesn't run. If I replace it with if(1), the gun fires continously, so I know the code around it is good.

Any ideas please ?

Thanks

Posted By: croman

Re: HELP: Using the mouse to trigger events ? - 07/24/08 17:08

wait, are you using c-script or lite-c? anyway, it should work. if you're using c-script then i dont why it happens but with lite-c i have all working fine. just continue using if(mouse_left == ON) if you're still having that problem.
Posted By: dracula

Re: HELP: Using the mouse to trigger events ? - 07/24/08 19:00

In Lite C

if (mouse_left == ON) works

if (mouse_left == on) doesn't work

I had forgotten case sensitivity

Thanks !
© 2023 lite-C Forums