Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   commas in strings (https://forums.graalonline.com/forums/showthread.php?t=51022)

Duwul 02-11-2004 04:30 AM

commas in strings
 
Well, I'm rescripting the chat system for my server. Hehe.

Basically, it stores your chat text in a string, then sends to everyone else to display on screen. However, everything after a comma, it doesn't show.

I tried quoting " " the whole string, basically its just
NPC Code:

setstring this.chat,"#p(1)";



That does not work. I even used a for loop to go through the whole #Is and even set them into a another string. (Yes, this would get rid of the commas, oh well.)

Any suggestions?

Python523 02-11-2004 04:33 AM

Where did you get the #p(1) from

Duwul 02-11-2004 04:43 AM

I'm originally triggering from the clientside. Sorry probably left that out.

Python523 02-11-2004 06:42 AM

Show me the triggeraction part

Termina_Owner 02-11-2004 09:33 AM

I found a bypass to that...

NPC Code:

if (actionserverside){
sendpm #p(0);
}
//#CLIENTSIDE
if (playerchats){
setstring message,;
addstring message,#c;
triggeraction 0,0,serverside,#s(message),;
}



Addstrings would make the "'s and the ,'s stay. It works magic ;P

Duwul 02-12-2004 12:00 AM

Rance, I'm not using sendpm...but that also might work. I'll try it.

Jagen, here's the triggeraction.

NPC Code:

iif (playerchats){
setstring this.chat,#c;
setplayerprop #c,;
triggeraction 0,0,serverside,-Chat,chat,#s(this.chat);
setstring this.chat,;
}



Of course, this is clientside. Would I have to quote it clientside?

Python523 02-12-2004 03:48 AM

Quote:

Originally posted by Duwul
Rance, I'm not using sendpm...but that also might work. I'll try it.

Jagen, here's the triggeraction.

NPC Code:

iif (playerchats){
setstring this.chat,#c;
setplayerprop #c,;
triggeraction 0,0,serverside,-Chat,chat,#s(this.chat);
setstring this.chat,;
}



Of course, this is clientside. Would I have to quote it clientside?

The string handling isn't any different... make the param
"#s(this.chat)"

Duwul 02-12-2004 04:45 AM

I thought so. However, Rance's method worked. I guess I'll just be using that. =P
Thanks for your help.


All times are GMT +2. The time now is 12:21 AM.

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