View Single Post
  #1  
Old 01-26-2009, 02:46 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Callstack Access

Making an item system, I have a function that looks like this:

PHP Code:
public function addItem(itemidquantity) {
  
// code here
  
temp.callstack getcallstack();
  echo(
"C:" SPC callstack[callstack.size() - 2].scriptcallobject SPC callstack.size());
  
// code here

The problem I'm having is that the callstack does not have an object for scripts that call it outside of a function block. For example, a weapon below:
PHP Code:
findPlayer("cbk1994").addItem(1001); 
Echos "C: 1" meaning that there is only one entry, which is the current object/function.

However, if this is used, it works perfectly:
PHP Code:
function onCreated() {
  
findPlayer("cbk1994").addItem(1001);

Echoes "C: -Guns 2" (-Guns being the name of the weapon)

This is, of course, serverside. It would be great if this could be fixed ASAP, or if someone knows a solution.

Thanks.
__________________
Reply With Quote