Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-24-2004, 02:52 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
A little help with with()

What I'm trying to do is to get some strings for the specified player, using with (getplayer())

I've tried many many different ways but nothing is working. I've tried setting this.strings, thiso.strings, level.strings. I just don't understand why it's not working.

NPC Code:

WAY 1------------------------------------------------
if (actionserverside) {
if (strequals(#p(0),load)) {
with (getplayer(#p(1))) { // getting the strings from
setstring thiso.test,#F,#s(client.hp);
}
with (getplayer(#p(2))) { // the account that is trying to get the strings
setstring client.test,#s(thiso.test);
}
}
}
WAY 2------------------------------------------------
if (actionserverside) {
if (strequals(#p(0),load)) {
with (getplayer(#p(1))) {
setstring this.test,#F,#s(client.hp);
}
}
}
// access it from clientside
WAY 3------------------------------------------------
if (actionserverside) {
if (strequals(#p(0),load)) {
with (getplayer(#p(1))) {
setstring thiso.test,#F,#s(client.hp);
}
setstring this.test,#s(thiso.test);
}
}
// access this.test later



Anyone help?
__________________
V$:CONFL16T
Reply With Quote
  #2  
Old 06-24-2004, 03:04 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
The first way is correct, except that you can only use thiso if you are using with () to get to another NPC. It is not used for another player, because they both have the same this. variables. Just use this..
The second way proves you did not understand clientside/serverside, I think.
The third way is just not needed.

Who hacked your account and made a thread that actually made sense?
Reply With Quote
  #3  
Old 06-24-2004, 11:53 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
It's not that I don't understand client/serverside, it's just that I haven't used it in a long time, but anyways. You are saying if, in the first example, I would've used this.strings, it would've been correct?

Good grief...
__________________
V$:CONFL16T
Reply With Quote
  #4  
Old 06-25-2004, 12:21 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Yes, I think that would have been correct.
Reply With Quote
  #5  
Old 06-25-2004, 12:23 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Well I got it to work, but I had to nest them:
NPC Code:

with (getplayer(#p(1))) {
setstring this.test,bla;
with (getplayer(#p(2))) {
setstring client.test,#s(this.test);
}
}



But I suppose it's alright, atleast it works
__________________
V$:CONFL16T
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:02 AM.


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