g_msgPos question


(BlackEight) #1

I want to put both g_msgPos messages in 1 and 2 position (which are cp and left side echo space). I want to ask what am i supposed to do:/
I have an idea. In server.cfg i simple make:

set g_msgs 300
set g_msgPos 2
seta g_msg1 “test”
seta g_msg2 “test”

and i create test.cfg file in server nq folder:

set g_msgs 300
set g_msgPos 1
seta g_msg1 “test”
seta g_msg2 “test”

Then i put in server.cfg this line:

exec test.cfg

Will this work anyway?

I run nq 1.2.5 on linux system.


(Wezelkrozum) #2

In short, No. The server will read the server.cfg. and then immediatly execute the test.cfg. This means the last instructions win and the messages will be in position 1.


(BlackEight) #3

Yeah,you were right. It worked exactly the way you said it will:) I found sth like this on other site:

“switch(g_msgpos.integer) {
case MSGPOS_CENTER:
AP(va(“cp “%s””,banner));
break;
case MSGPOS_LEFT_BANNER:
AP(va(“cpm “%s””,banner));
break;
case MSGPOS_CHAT:
default:
AP(va(“chat “%s””,banner));
}”

and

“if(g_msgpos.integer & 1)
AP(va(“cp “%s””,banner));
if (g_msgpos.integer & 2)
AP(va(“cpm “%s””,banner));
if (g_msgpos.integer & 4)
AP(va(“chat “%s””,banner));”

Quotation marks (") have been put by me. The second piece…do you happen to know how it might work? I am not sure if it goes for nq anyway:/


(zbzero) #4

Man this not will work, this is the code, not work in configs…