View Single Post
  #5  
Old 09-08-2010, 02:30 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Set a variable like "this.gunOut" on the first press. If it's false, show the gun. If it's true, shoot. If the weapon changes or the player puts the gun away, set it to false.
Believe I tried that in multiple ways. still it shoots on the second equip, Here's what I have so far:

PHP Code:
//#CLIENTSIDE
function onKeyPressed(codekey)
switch(
key)

case 
"d":

this.equip = !this.equip;

if(!
this.equip || this.equip == false)
freezeplayer(0.1);

setani(this.gani.idlenull);

replaceani("walk"this.gani.walk);

replaceani("idle"this.gani.idle);

if(
this.equip || this.equip == true)

onFire();

break; 
Missing braces intentional on here. Other then that, something i missed?

Edit: Feel free to state anything you see wrong, but i believe i found my own mistake.

Quote:
Originally Posted by papajchris View Post
No he means like how on Era when you press D to equpt a gun, it ONLY equipts it. It doesnt shoot. Not until you press D again. (Or i tihnk thats whats he meant
Yes it is what I meant.

Last edited by khortez; 09-08-2010 at 02:36 AM.. Reason: Mistake possibly found
Reply With Quote