Page 1 of 1

Hi another question ;)

Posted: Wed Sep 24, 2008 2:11 am
by richardali
/*
var npcdatabase := ReadConfigFile("npcdesc");
var alignment := npcdatabase[npc.npctemplate].alignment;

Print( npc.alignment );

If( npc.alignment == "evil" )
Return TEXT_MURDER_COLOR;
EndIf

if( npc.alignment == "good" )
Return TEXT_INNOCENT_COLOR;
EndIf
*/

i'm working on my singleclickhook system, adapting for zuluhotel system, builded by beaud, i don't know why i used print after the variable 'alignment', and returning <unitialized object> i don't know what to do =/, i'm working in pol 096.7 core

thanks

Ps: MontuZ, thanks by the other post

Re: Hi another question ;)

Posted: Wed Sep 24, 2008 3:06 am
by Pierce
You already read out the alignment from the npcdesc.
Assuming that the npc has an alignment it should
look this way:

Code: Select all

var npcdatabase := ReadConfigFile("npcdesc");
var alignment := npcdatabase[npc.npctemplate].alignment;

Print( alignment );

If( alignment == "evil" )
Return TEXT_MURDER_COLOR;
EndIf

If( alignment == "good" )
Return TEXT_INNOCENT_COLOR;
EndIf

Re: Hi another question ;)

Posted: Wed Sep 24, 2008 7:49 am
by richardali
yes dude i did that and returning <unitialized object>

thanks

Re: Hi another question ;)

Posted: Wed Sep 24, 2008 1:31 pm
by richardali
solved :)

the problem are was:

var npcdatabase := ReadConfigFile("::npcdesc");
var alignment := npcdatabase[npc.npctemplate].alignment;

in the '::'

i put it and now the script can read the config file :)