Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Keydown / Enablefeatures? (https://forums.graalonline.com/forums/showthread.php?t=134259946)

devilsknite1 07-25-2010 09:01 AM

Keydown / Enablefeatures?
 
I've disabled the use of a few things using enable features (Map, Pause, Q, R, S+A, S+D, Display of hearts over head, and the use of nicknames). Now I can't use the D key in:
PHP Code:

if ( keydown) ) { 

:confused:

I've tried enable weapons, etc. Nothing worked... onWeaponFired() didn't work either (while weapons were enabled of course :p)

So what's happening? I can use
PHP Code:

if ( keydown2getkeycode"d" ), false ) ) { 

but I want to know why I can't access the D key via keydown();

EDIT ::
Other keys work.. The M key doesn't seem to work either, but that's understandable because I disabled it. Does S+D disable the D key itself?

fowlplay4 07-25-2010 09:06 AM

D (weapon) is 4.. 5 = Sword, 6 = Grab

devilsknite1 07-25-2010 09:07 AM

Damn wiki told me 7 :whatever:

fowlplay4 07-25-2010 09:19 AM

You must of misread the table because it clearly says 6 (and has been since April 26th at least).

devilsknite1 07-25-2010 09:21 AM

Err, 6. Whatever :(

Either way, it's still wrong...

oo_jazz_oo 07-25-2010 09:28 AM

player.selectedweapon is the index of the selected weapon in the players weapon aray.

PHP Code:

if (player.selectedweapon == player.weapons.index(findweapon("Name"))) 


fowlplay4 07-25-2010 09:30 AM

Quote:

Originally Posted by devilsknite1 (Post 1589495)
Err, 6. Whatever :(

Either way, it's still wrong...

and now it's fixed. :)

devilsknite1 07-25-2010 09:34 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1589500)
player.selectedweapon is the index of the selected weapon in the players weapon aray.

PHP Code:

if (player.selectedweapon == player.weapons.index(findweapon("Name"))) 


Shouldn't it be

PHP Code:

if ( player.selectedweapon == player.weapons.indexblah ] ) { 

?

cbk1994 07-25-2010 09:38 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1589500)
player.selectedweapon is the index of the selected weapon in the players weapon aray.

PHP Code:

if (player.selectedweapon == player.weapons.index(findweapon("Name"))) 


Should be:

PHP Code:

if (player.weapon == this) { // weapon is currently selected 

For selecting a weapon:
PHP Code:

player.selectedWeapon player.weapons[player.weapons.index(findWeapon("Weapon"))].id// select a weapon by name 

Not sure if there is a better way to do the second, but yours probably won't work since player.weapons is an array of weapon objects.


All times are GMT +2. The time now is 08:44 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.