Quote:
|
Originally Posted by Prozac
I have used setstring for at least five years, and in the wiki, my code example above is how setstring should be formatted - as far as i can tell.
Perhaps I should go a step back to algorithm-speak, and if you don't want me using setstring, then you can tell me another way/method to do it in gs2.
|
Okay, your first problem is that setstring is expecting two parameters of the "string" type. It looks as though you are trying to feed it two of the same type of argument and expect it to handle each one of them differently.
In other words, it looks like in:
Quote:
NPC Code:
setstring(serverr.radio_station1e,serverr.radio_st ation1d);
|
you are trying to set a string
named serverr.radio_station1e to the
value of serverr.radio_station1d, right?
Assuming the above, your first argument's in reality going to be parsed for a value just like the second one is. You are inadvertantly setting a string with a name of the value of the first argument to the value of the second argument; in the above example, if serverr.radio_station1e was "pie", you would be setting a string named "pie" to whatever the value of serverr.radio_station1d.
Following that, the proper usage of setstring for this situation would be:
NPC Code:
setstring("serverr.radio_station1e",serverr.radio_ station1d);
However, I contend that this is all just a silly waste of time considering the fact that GS2 is designed with the awesome power of variants (see
here for more information). Instead, you can simply:
NPC Code:
serverr.radio_station1e = serverr.radio_station1d;
Quote:
|
so i ask again, why does the information get sent to the rc but not set into the string?
|
^
Quote:
Also, NL is not working in sendpm as it should:
sendpm("test"@ NL @"123"); //causes an error: unexpected token: )
sendpm("test NL 123"); //shows the text NL in the string
sendpm("test "@"NL"@" 123"); //shows the text NL in the string
and i am out ot ideas of how else to use NL. help?
|
Much like SPC, you would
replace the @ with NL.