Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   warping players (https://forums.graalonline.com/forums/showthread.php?t=31368)

darkriders_p2p 06-11-2002 06:54 AM

warping players
 
Ok I'm making an NPC where when the player say warp "whatever", it would set the whatever into a server.string.
So I would say "warp darkriders_p2p" and it would set server.warp=darkriders_p2p.This is the script:
NPC Code:

if (playerchats) {
if (startswith(warp,#c)) {
addstring server.warp,#e(5,-1,#c);
}
}


k now I need the player I'm working this on to warp to the level, &
the string to reset.I am thinking it would have to be a hidden NPC the player gets when they start rite?
something like:
NPC Code:

if (isweapon) {
timeout=0.05;
if (timeout) {
if (strequals(#s(server.warp),#a)) {
setlevel2 asteria_hatnpc.nw,x,y;
deletestring server.warp,;
}
}
}


why doesn't that work?
It doesn't even warp me

Warcaptain 06-11-2002 07:59 PM

with npcserver:
NPC Code:

if (actionserverside){
tokenize2 #p(2);
with (getplayer(#p(0))){
setlevel2 #p(1),strtofloat(#t(0)),strtofloat(#t(1));
}
}
//#CLIENTSIDE
if (playerchats&&startswith(warp,#c)){
tokenize #c;
triggeraction 0,0,serverside,Warper,#t(1),#t(1),#t(2) #t(3);
setplayerprop #c,warped;
}


say warp 'acc' 'level' 'x' 'y'
(if the weapon isnt called Warper, replace Warper with whatever it is)

without:
NPC Code:

//WARPER weapon
if (playerchats&&startswith(warp,#c)){
setstring server.warp,#e(5,-1,#c);
setplayerprop #c,warped;
}
//Warping weapon
if (playerenters||timeout&&isweapon){
if (!strequals(#s(server.warp),)){
setstring client.warp,#s(server.warp);
unset server.warp;
tokenize #s(client.warp);
setlevel2 #t(0),strtofloat(#t(1)),strtofloat(#t(2));
}
timeout=.05;
}


that should work, but im at school now so it may be a bit buggy since im doing it off the top of my head.

Warcaptain 06-11-2002 08:00 PM

oh and by the way...

the server you have it on must be enabled to set server flags or it wont work :-)

Falcor 06-11-2002 08:12 PM

BTW there is a little button call EDIT.

And DON'T POST ENTIRE SCRIPTS!

Shorty2Dope 06-11-2002 08:36 PM

oo now I can actually figure out how to do this stuff, just need to figure out what some of these commands are first :D

WHIPENIE4 06-11-2002 10:02 PM

Quote:

Originally posted by Falcor
BTW there is a little button call EDIT.

And DON'T POST ENTIRE SCRIPTS!

(X-Mann)
Stop Complaining

darkriders_p2p 06-11-2002 10:09 PM

Quote:

Originally posted by Warcaptain
oh and by the way...

the server you have it on must be enabled to set server flags or it wont work :-)

well this is offline and no dice, it doesn't warp

Warcaptain 06-11-2002 11:50 PM

Quote:

Originally posted by Falcor
BTW there is a little button call EDIT.

And DON'T POST ENTIRE SCRIPTS!


nothing wrong with posting whole scripts

its my choice to post them and help if i want and im not harming.
i know when i was learning i would love to have people help and i needed it too, so im trying to return the favor that so many people including you, never did for me.

so stop being so selfish okay?

if you dont wanna see the script, dont look
simple

Warcaptain 06-11-2002 11:54 PM

NPC Code:

//Warping weapon
if (playerenters||timeout&&isweapon){
if (!strequals(#s(server.warp),)){
tokenize #s(server.warp);
if (strequals(#t(0),#a)){
setstring client.warp,#s(server.warp);
unset server.warp;
tokenize #s(client.warp);
setlevel2 #t(1),strtofloat(#t(2)),strtofloat(#t(3));
say2 warped;
}
}
timeout=.05;
}



im dumb lol
but like i said, i was at school hehe

Shorty2Dope 06-12-2002 01:58 AM

Quote:

Originally posted by Warcaptain



nothing wrong with posting whole scripts

its my choice to post them and help if i want and im not harming.
i know when i was learning i would love to have people help and i needed it too, so im trying to return the favor that so many people including you, never did for me.

so stop being so selfish okay?

if you dont wanna see the script, dont look
simple

Yea sometimes it helps me more by seeing scripts and working backwards. Then figure out what each thing does from there.

Falcor 06-12-2002 03:09 AM

I know what you are saying, They can learn from the script knowing that the entire thing works and can dissasemble it, but think about the old saying "If it ain't broke don't fix it" why recode what is infront of you, ya know? and only about 5% of the peple who acually look at the entire script that was given to them on a silver platter, will take the time to figure it out, becasue you have solved their problem, not directed them in the way to helping themselfs by furthering their knowledge.


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

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