Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Warping with NPC server... (https://forums.graalonline.com/forums/showthread.php?t=21162)

G_yoshi 01-14-2002 11:39 PM

Warping with NPC server...
 
ok...I am sure it's been gone over before but how do I use an NPC to warp a player?

I have done
NPC Code:

triggeraction 0,0,warp,olsl.nw,30,30;


in one NPC...and in the control-NPC I have
NPC Code:

if (actionwarp) {
with (getplayer(#a)) {
setlevel2 #p(0),#p(1),#p(2);
}
}



What am I doing wrong?

TDO2000 01-15-2002 12:04 AM

Re: Warping with NPC server...
 
Quote:

Originally posted by G_yoshi
ok...I am sure it's been gone over before but how do I use an NPC to warp a player?

I have done
NPC Code:

triggeraction 0,0,warp,olsl.nw,30,30;


in one NPC...and in the control-NPC I have
NPC Code:

if (actionwarp) {
with (getplayer(#a)) {
setlevel2 #p(0),#p(1),#p(2);
}
}



What am I doing wrong?

setlevel2 #p(0),#p(1),#p(2); <-- there is something wrong in it (that would only affect the x and y of the player)

needs to be ...strtofloat(#p(1)), strtofloat(#p(2));
but I have not enough experience with NPC-Servers to get the other error (if there is one)

edit:
um could it be possible that NPC-Server doesn't know the players account if u trigger it? u Could use #a as a triggeraction param:

triggeraction 0,0,#a,warp,olsl.nw,30,30;
and read it out with #p(0)

G_yoshi 01-15-2002 12:18 AM

Re: Re: Warping with NPC server...
 
Quote:

Originally posted by TDO2000


setlevel2 #p(0),#p(1),#p(2); <-- there is something wrong in it (that would only affect the x and y of the player)

needs to be ...strtofloat(#p(1)), strtofloat(#p(2));
but I have not enough experience with NPC-Servers to get the other error (if there is one)

edit:
um could it be possible that NPC-Server doesn't know the players account if u trigger it? u Could use #a as a triggeraction param:

triggeraction 0,0,#a,warp,olsl.nw,30,30;
and read it out with #p(0)

Thanks...when it reads #p(index) it should read it as whatever it is...I don't think it would make any difference, but I'll try it later :)

TDO2000 01-15-2002 12:25 AM

Re: Re: Re: Warping with NPC server...
 
Quote:

Originally posted by G_yoshi


Thanks...when it reads #p(index) it should read it as whatever it is...I don't think it would make any difference, but I'll try it later :)

no it doesn't had the same problem some time ago... at the beginning (without strtofloat) the position was always 0,0 but I think in your case it won't make any difference ;)

Loriel 01-15-2002 02:17 AM

You do need strtofloat( ) around the params, :(
But the other mistake is that you did not put "server" at the beginning of the action.

triggeraction 0,0,serverwarp,olsl.nw,30,30;

if (actionserverwarp) setlevel #p(0),strtofloat(#p(1)),strtofloat(#p(2));

G_yoshi 01-15-2002 07:26 AM

Quote:

Originally posted by Loriel
You do need strtofloat( ) around the params, :(
But the other mistake is that you did not put "server" at the beginning of the action.

triggeraction 0,0,serverwarp,olsl.nw,30,30;

if (actionserverwarp) setlevel #p(0),strtofloat(#p(1)),strtofloat(#p(2));

AH!!!!

THANK YOU :D!


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

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