Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:41 AM.


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