Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   getplayer (https://forums.graalonline.com/forums/showthread.php?t=17406)

Andor_GP1 11-20-2001 05:57 AM

getplayer
 
Ok say i have the account of a person set to the variable this.buddy. how would i take his chat string (#c) using getplayer and set it to the chat string of the npc.?

BocoC 11-20-2001 10:35 AM

First off. Is this a NPC Weapon or a serverside NPC?

grim_squeaker_x 11-20-2001 07:02 PM

NPC Code:
if (initialized||timeout) {
with (getplayer(#s(this.buddy))) message #c;
timeout=0.1;
}


Should work.

Andor_GP1 11-21-2001 04:10 AM

serverside npc =p and grim that didn't work (i did change the timeout to .5[.1 won't wok serverside on p2p])0.o thanx anyway though :D

Faheria_GP2 11-21-2001 07:08 AM

...

.1 works for NPC-Server, it's .05 that don't work

Andor_GP1 11-21-2001 07:12 AM

o
 
i thought it was .1 that didn't o well =p either way it don't work.

grim_squeaker_x 11-21-2001 08:33 PM

Then try this:
NPC Code:
if (initialized||timeout) {
with (getplayer(#s(this.buddy))) setstring this.buddytext,#c;
message #s(this.buddytext);
timeout=0.1;
}

And if that doesn't work I'm stumped.

Andor_GP1 11-22-2001 04:01 AM

nope... you be stumped just like me : / thanx anyway though! :D

Faheria_GP2 11-22-2001 04:38 AM

Quote:

Originally posted by grim_squeaker_x
NPC Code:
if (initialized||timeout) {
with (getplayer(#s(this.buddy))) message #c;
timeout=0.1;
}


Should work.

grim, players dont message, they setplayerprop...

NPC Code:

if (initialized||timeout) {
with (getplayer(#s(this.buddy))) setplayerprop #c,#c;
timeout=0.1;
}



that should work

Saga2001 11-22-2001 06:10 AM

:-)
 
Supersonic is one smart cookie!
--PastAustin

Andor_GP1 11-22-2001 08:08 AM

well grim was right in the fact i want the npc to say the message not the player. but it still doesn't wok :(

Andor_NPC-Admin1 12-18-2001 03:54 AM

hmm.......i dunno
maybe add an index to #c ? =8

Xaviar 12-18-2001 08:53 AM

Quote:

Originally posted by Faheria_GP2


grim, players dont message, they setplayerprop...

NPC Code:

if (initialized||timeout) {
with (getplayer(#s(this.buddy))) setplayerprop #c,#c;
timeout=0.1;
}



that should work

All that does is make this.buddy say what he was saying before...Essentially the same as if (playerenters) setlevel #L;, just a waste of processor power and bandwidth

kp_p2p 12-18-2001 10:10 AM

setlevel #L; causes an infinite loop and freezes graal.

Andor_NPC-Admin1 12-18-2001 12:08 PM

I think he means that both the #c 's have different causes.
The first #c is the npc chat, and the second is the player chat
so maybe it would need to be:

if (initialized||timeout) {
with (getplayer(#s(this.buddy))) setplayerprop #c(-1),#c(0);
timeout=0.1;
}

to seperate its different #c =)

Xaviar 12-18-2001 11:18 PM

Or just use 'message', because he wanted the chat text of the npc to be set to what this.buddy was saying...

jeff335 12-19-2001 01:19 AM

or maybe setcharprop? Honestly, does nobody ever read the commands reference?

Andor_NPC-Admin1 12-21-2001 06:26 AM

ohh yea, setcharprop, nor setplayerprop =P


All times are GMT +2. The time now is 04:29 AM.

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