View Single Post
  #1  
Old 01-01-2011, 10:43 PM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
function not found in script

Hi

I'm trying to code an Inventory with GuiControl for my SQL-based Item system, but I'm running into a problem.

I want to make a Combobox, that has different numbers of rows depending on how many categories of items the player has.

NPC Code:

Inventory_Categories.clearrows();
temp.categories = player.getCategories();
for (temp.i=0; temp.i < temp.categories.size(); temp.i++) {
Inventory_Categories.addrow(temp.i,temp.categories[temp.i][0]);
}
Inventory_Categories.setSelectedRow(0);



that's my getCategories() function:
NPC Code:

public function getCategories(){
temp.categories = requestSQL("SELECT DISTINCT category FROM 'player_item' WHERE account='" @player.account@ "'",true);
if(!temp.categories.completed) {
waitfor(temp.categories,"onReceiveData",60);
}
return temp.categories.rows;
}



That's what the F2-Log says.
Quote:
GraalScript: Function Player AlexanderK.getCategories not found in script of Weapon -Inventory
I just don't see what's wrong. Are weapons not allowed to access player.-functions?

I know the function works, as this NPC works:

NPC Code:
 //#Clientside
function onCreated() {
this.setshape(1,32,64);
this.chat="Touch me to find out how many categories you have";

}
function onPlayerTouchsMe() {
this.chat=player.getCategories().size() @ " , first category: " @ player.getCategories()[0][0] ;
}



I hope someone can help me.
Reply With Quote