Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   strlen + #e (https://forums.graalonline.com/forums/showthread.php?t=50614)

mhermher 01-26-2004 11:34 PM

Quote:

Originally posted by ZeLpH_MyStiK

They both work -.- Try it out before you tell someone incorrect information please.


Fine, make a level..
a NPC:

if (timeout||playerenters) {
this.msg=123456;
unset this.msg;
timeout=0.05;
message #v(this.msg);
}

Try that.

VeX_RaT_Boy 01-26-2004 11:41 PM

Quote:

Originally posted by mhermher



Fine, make a level..
a NPC:

if (timeout||playerenters) {
this.msg=123456;
unset this.msg;
timeout=0.05;
message #v(this.msg);
}

Try that.

He is setting a string, not a variable.

R0bin 01-26-2004 11:53 PM

setstring this.word,Blah;
unset this.word;

message #s(this.word);

Will still message Blah.

ZeLpH_MyStiK 01-27-2004 02:24 AM

Quote:

Originally posted by R0bin
setstring this.word,Blah;
unset this.word;

message #s(this.word);

Will still message Blah.

Not when I tried it x.x think about it, here's the logic:
if you do setstring clientr.test,hi; and you open the attributes, the string is shown in the flags section therefore it can be unset. If you still dont believe me, try this, its a weapon called Test:
NPC Code:

if (actionserverside) {
putnpc2 playerx,playery,{
if (created) message I'm here;
if (playerchats) {
if (strequals(#c,set)) setstring this.test,hi;
if (strequals(#c,unset)) unset this.test;
if (strequals(#c,say)) message #s(this.test);
}
}
}
//#CLIENTSIDE
if (weaponfired) {
triggeraction 0,0,serverside,Test,;
}


just say "set" "say" you'll see the npc say hi
then say "unset" "say" the npc will then say nothing b/c this.test is no longer there

osrs 01-27-2004 03:21 AM

Quote:

Originally posted by mhermher



Fine, make a level..
a NPC:

if (timeout||playerenters) {
this.msg=123456;
unset this.msg;
timeout=0.05;
message #v(this.msg);
}

Try that.

NPC Code:

if(created)
set flag name;



Use unset flag name in that case, not with variables or strings :P

mhermher 01-27-2004 10:31 AM

Quote:

Originally posted by osrs


NPC Code:

if(created)
set flag name;



Use unset flag name in that case, not with variables or strings :P

That's what i was saying..

adam 01-27-2004 05:15 PM

geez lame people.
find another thread. this one has already been answered.







and to delete a string use setring

NPC Code:

setstring <string>,;



All times are GMT +2. The time now is 06:53 AM.

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