Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Making Server Flags (https://forums.graalonline.com/forums/showthread.php?t=56310)

Zickle 12-05-2004 04:32 AM

Making Server Flags
 
I want to make a script where when the player says "/eventpost TEXT" the text gets turned into a server flag like "server.bwpost=TEXT" and then the #s part of the code shown below in the playerenters and visible part display the text.

I had a good working way but I found out it needed server flags for everyone else to see it.

NPC Code:
// NPC made by ZicklePop
//#CLIENTSIDE
if (playerenters) {
showtext txt,x,y,verdana,nc,#s(server.bwpost);
changeimgcolors txt,1,1,1,1;
changeimgzoom txt,.5;
}
//#CLIENTSIDE
while (visible) {
showtext txt,x,y,verdana,nc,#s(server.bwpost);
changeimgcolors txt,1,1,1,1;
changeimgzoom txt,.5;
sleep 1;
}
//#CLIENTSIDE
if (playerchats) {
tokenize #c;
if (strequals(#t(0),/eventpost)) {
triggeraction 0,0,serverside,eventpost,/eventpost,#v(strtofloat(#s(server.bwpost));
}
}



Any help please?

Thanks as always, ZicklePop

osrs 12-05-2004 06:06 AM

You don't really need a server flag on your idea, a client flag is ok. Just use some server-side scripting to send the information to all players accounts. Also, you don't need to use '//#CLIENTSIDE' three times on the same script.

Slash-P2P 12-05-2004 06:30 AM

Quote:

Originally Posted by osrs
You don't really need a server flag on your idea, a client flag is ok. Just use some server-side scripting to send the information to all players accounts. Also, you don't need to use '//#CLIENTSIDE' three times on the same script.

But what about players who log on after the message has been set? They won't see the message set.

NPC Code:

// NPC fixed by Slash
if (playerchats) {
if (startswith(/eventpost,#c)) {
setstring server.bwpost,#e(11,-1,#c);
}
}
//#CLIENTSIDE
if (created || playerenters) {
timeout = 1;
display();
}
if (timeout) {
if (playerscount > 0) {
timeout = 1;
}
display();
}
function display() {
showtext 0,x,y,verdana,c,#s(server.bwpost);
changeimgcolors 0,1,1,1,1;
changeimgzoom 0,.5;
}


osrs 12-05-2004 06:46 AM

Quote:

Originally Posted by Slash-P2P
But what about players who log on after the message has been set? They won't see the message set.

Of course who wasn't online won't receive it, I just gave an idea, it is up to him to choose wich one he thinks better, also, it would be better to just help him with hints instead of the whole code. x-x

Kaimetsu 12-05-2004 07:00 AM

http://forums.graalonline.com/forums...ad.php?t=46557

Zickle 12-05-2004 07:36 AM

Quote:

Originally Posted by Slash-P2P
But what about players who log on after the message has been set? They won't see the message set.

NPC Code:

// NPC fixed by Slash
if (playerchats) {
if (startswith(/eventpost,#c)) {
setstring server.bwpost,#e(11,-1,#c);
}
}
//#CLIENTSIDE
if (created || playerenters) {
timeout = 1;
display();
}
if (timeout) {
if (playerscount > 0) {
timeout = 1;
}
display();
}
function display() {
showtext 0,x,y,verdana,c,#s(server.bwpost);
changeimgcolors 0,1,1,1,1;
changeimgzoom 0,.5;
}



Thanks alot for helping, but it won't show up online. The server flags are setting this time.

Slash-P2P 12-05-2004 03:34 PM

Quote:

Originally Posted by Zickle
Thanks alot for helping, but it won't show up online. The server flags are setting this time.

Try using a serverr. flag

Zickle 12-05-2004 05:32 PM

Oh okay, thanks that worked!

ZeroTrack 12-05-2004 05:32 PM

Quote:

Originally Posted by Slash-P2P
Try using a serverr. flag

why dont people ever use db npcs instead of server flags :\ my personal opinion is db npcs lag less than server flags

Kaimetsu 12-05-2004 07:18 PM

Quote:

Originally Posted by ZeroTrack
my personal opinion is db npcs lag less than server flags

That's quite a vague statement. How does a flag experience lag?

Slash-P2P 12-05-2004 07:57 PM

Quote:

Originally Posted by ZeroTrack
why dont people ever use db npcs instead of server flags :\ my personal opinion is db npcs lag less than server flags

They probably lag less just sitting there on the server, but I doubt they lag less when they are being read or wrote to.

ZeroTrack 12-05-2004 11:41 PM

Quote:

Originally Posted by Kaimetsu
That's quite a vague statement. How does a flag experience lag?

i donno i've seen them lag more , for instance i had an NPC using server flags and it was listed in the top 10 for cpu usage, i changed it to store in a dbnpc and it came off the list ... maybe it was just the way the script was written but ever sence then i dont use server flags ::shrug::

Kaimetsu 12-06-2004 04:07 AM

Quote:

Originally Posted by ZeroTrack
i had an NPC using server flags and it was listed in the top 10 for cpu usage, i changed it to store in a dbnpc and it came off the list

Firstly, that wouldn't be a firm basis for saying that the strings themselves are lagging. Such is meaningless nonsense.
Secondly, it doesn't seem like sufficient basis to peddle your theories to learning scripters. I would suggest compiling more information before taking such bold steps.

Slash-P2P 12-06-2004 05:28 AM

Quote:

Originally Posted by ZeroTrack
i donno i've seen them lag more , for instance i had an NPC using server flags and it was listed in the top 10 for cpu usage, i changed it to store in a dbnpc and it came off the list ... maybe it was just the way the script was written but ever sence then i dont use server flags ::shrug::

Sometimes it takes a bit for the list to reload all the scripts and get the time, so NPCs might not show up for a little bit after you make a change like that.

ZeroTrack 12-06-2004 03:32 PM

Quote:

Originally Posted by Kaimetsu
Firstly, that wouldn't be a firm basis for saying that the strings themselves are lagging. Such is meaningless nonsense.
Secondly, it doesn't seem like sufficient basis to peddle your theories to learning scripters. I would suggest compiling more information before taking such bold steps.

Im starting to think you post only to debate people.... Such is meaningless nonsense haha


[edit=loriel]oops, I hit the wrong button. Sorry.[/edit]

Kaimetsu 12-06-2004 05:27 PM

Quote:

Originally Posted by ZeroTrack
Im starting to think you post only to debate people....

A quick search for my recent posts would suggest otherwise.

Loriel 12-06-2004 06:41 PM

Quote:

Originally Posted by ZeroTrack
Im starting to think you post only to debate people.

He would not need to debtate had you not spread false information!

ZeroTrack 12-06-2004 07:29 PM

Quote:

Originally Posted by Loriel
He would not need to debtate had you not spread false information!

i believe i said im my OPINION? come on i know your english is better than that you do know what opinion means right, quit the personal attacks Ben your immaturity is showing

Kaimetsu 12-06-2004 09:21 PM

Quote:

Originally Posted by ZeroTrack
i believe i said im my OPINION?

...so?

Loriel 12-06-2004 10:08 PM

Quote:

Originally Posted by ZeroTrack
i believe i said im my OPINION?

It was false information nevertheless, whether you give it as your opinion or as supposed fact.


Quote:

come on i know your english is better than that you do know what opinion means right, quit the personal attacks Ben your immaturity is showing
... hypocrite... ?


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

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