Quote:
|
Originally Posted by Bl0nkt
Keep the money that's in that safe in a serverr. string.
|
What the hell, Hachi? Use a DB NPC, did you absorb nothing I tried to teach you? I guess you like opening your server. flags and wondering what the hell each flag means.
Quote:
|
Originally Posted by Bl0nkt
NPC Code:
if (playerchats && strequals(#c,/paycheck)) {
playerrupees += 250;
setstring 'serverr.strings',strtofloat(#s('serverr.strings') ) - 250;
}
|
NPC Code:
setstring 'serverr.strings',#v(strtofloat(#s('serverr.strings')) - 250);
Use the flag prefix thiso. and with(). Thiso. flags belong to the npc that is 'calling' another with the with() function, for example,
NPC Code:
thiso.var = 5;
with (getnpc(DBNPC)) this.var += thiso.var;
If you were to just do "with (getnpc(DBNPC)) this.var += this.var;"
it would add DBNPC's this.var to itself, however, since thiso.var belongs to the current npc and it equals 5, it adds 5 to DBNPC's this.var. I hope you understand this...