Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Simple Scripting Question(s) (https://forums.graalonline.com/forums/showthread.php?t=65240)

Omini 04-07-2006 06:14 PM

Simple Scripting Question(s)
 
In reference to server.string and client.string

How do I read them in a script? Do I use strequels or what, 'cause I can never get it to work.

Like if (strequals(#s,client.string),1) {
I'm sure I've tried that before and it didn't work.

If anyone would be so kind as to give me a simple script, like -

if (read the string=0) {
show;
}
if (read the string=1) {
hide;
}
if (read the string=2) {
sleep .5;
}

Just something simple so I know what to do in the future please.

Thanks

Warcaptain 04-07-2006 08:26 PM

server.strings can only be read clientside
client strings can be read both client/serverside
so you would do
In GS1
NPC Code:

setstring(client.foo,bar);


In GS2
NPC Code:

client.foo="bar";


Omini 04-07-2006 08:30 PM

Ah, and how would I read the string in GS2?

Warcaptain 04-07-2006 10:08 PM

a way to check if client.foo equals bar is this
GS1
NPC Code:

strequals(#s(client.foo),bar)


GS2
NPC Code:

client.foo=="bar";


Skyld 04-07-2006 11:16 PM

Quote:

Originally Posted by Warcaptain
server.strings can only be read clientside

server. strings are only usable on the serverside. They are not sent to the client.

serverr. strings are readable on the clientside, but are only writable on the serverside.

napo_p2p 04-07-2006 11:36 PM

Quote:

Originally Posted by Warcaptain
In GS1
NPC Code:

setstring(client.foo,bar);


Actually, old gscript is more like:

PHP Code:

setstring client.foo,bar


Warcaptain 04-08-2006 04:08 AM

Yes sorry, you are both correct x_x

Its been a long time since I used both things.


All times are GMT +2. The time now is 06:29 PM.

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