Im having issues getting data from a dbnpc and putting it in gui, again. Im not sure why, but in this situation, all the values in the array in the dbnpc are showing up in the main window text on the gui. It should be splitting it up. Worked for a while, until I added some stuff in.
PHP Code:
function onCreated()
{
this.db = findnpc("NpcChat");
}
function onActionServerSide(){
if (params[0] == "getText"){
triggerClient("weapon", this.name, "getText", this.db.info);
}
}
//#CLIENTSIDE
function onActionClientSide(){
if (params[0] == "getText"){
temp.setup = params[1];
NpcChat_Window1.setText(temp.setup[0]);
NpcChat_Text1.setText(temp.setup[1]);
//temp.list = "";
//temp.data = {params[1][2], params[1][3], params[1][4], params[1][5]};
//for (temp.line: temp.data) {
// temp.list @= temp.line @ "\n";
//}
NPC_Chat_ItemList.addrow(temp.setup[2]);
NPC_Chat_ItemList.addrow(temp.setup[3]);
NPC_Chat_ItemList.addrow(temp.setup[4]);
NPC_Chat_ItemList.addrow(temp.setup[5]);
temp.img = temp.setup[6];
NpcChat_Image1.image = temp.img;
}
}
public function OpenWindow( data ){
if (NpcChat_Text1 != NULL) NpcChat_Window1.destroy();
triggerServer("weapon", this.name, "getText");
new GuiWindowCtrl("NpcChat_Window1") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "211,231";
useOwnProfile = true;
profile.bitmap = "guiarm_window.png";
canmove = true;
canresize = true;
closequery = false;
destroyonhide = false;
text = "Loading...";
x = 309;
y = 88;
new GuiTextCtrl("NpcChat_Text1") {
profile = GuiBlueTextProfile;
height = 20;
text = "";
width = 42;
x = 76;
}
new GuiScrollCtrl("NpcChat_MultiLine1_Scroll") {
profile = GuiBlueScrollProfile;
useOwnProfile = true;
profile.bitmap = "guiarm_scroll.png";
height = 75;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 176;
x = 19;
y = 143;
new GuiMLTextCtrl("NpcChat_MultiLine1") {
profile = GuiBlueMLTextProfile;
height = 32;
horizsizing = "width";
text = "Loading...";
width = 151;
}
new GuiMLTextCtrl("NpcChat_MultiLine2") {
profile = GuiBlueMLTextProfile;
height = 66;
horizsizing = "width";
text = "Loading...";
width = 151;
}
new GuiMLTextCtrl("NpcChat_MultiLine3") {
profile = GuiBlueMLTextProfile;
height = 32;
horizsizing = "width";
text = "Loading...";
width = 151;
}
new GuiMLTextCtrl("NpcChat_MultiLine4") {
profile = GuiBlueMLTextProfile;
height = 32;
horizsizing = "width";
text = "Loading...";
width = 151;
}
}
new GuiScrollCtrl( "Npc_Chat_Scroll" ) {
this.width = 250;
this.height = 330;
this.x = 19;
this.y = 143;
this.hScrollBar = "alwaysOff";
this.vScrollBar = "dynamic";
new GuiTextListCtrl( "Npc_Chat_ItemList" ) {
this.width = 250;
this.height = 330;
}
}
new GuiShowImgCtrl("NpcChat_Image1") {
x = 9;
partx = 0;
party = 60;
partw = 50;
parth = 36;
width = 150;
height = 150;
image = "block.png";
}
}
}
and in the dbnpc NpcChat as a flag:
PHP Code:
info= "Ramerd","You like girls?","YOURE ***!","I'm ***","","NO WAY!", "head22.png";
Like i said, the
PHP Code:
NpcChat_Window1.setText(temp.setup[0]);
is showing up the entire array, and shouldnt be as far as I can see. None of the other texts or lines are getting any values at all.