View Single Post
  #11  
Old 02-12-2010, 04:01 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Another handy thing is assigning WNPCs to vars. Let's say you got the following in -System/Inventory:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
inventory this;
  
// more stuff..
}

public function 
Toggle() {
  
// toggle

Then you could do something like this in -System/InputHandler:
PHP Code:
//#CLIENTSIDE
function HandleKey(key) {  // careful, I made this one up, assuming it was implemented in the WNPC earlier
  
if (key == "q")
    
inventory.Toggle();
  
// probably more stuff..

Reply With Quote