Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Admin Chat Commands... (https://forums.graalonline.com/forums/showthread.php?t=35107)

CrimsonLotus9838 08-05-2002 11:05 AM

Admin Chat Commands...
 
Just recently I've attempted to script 3 admin chat commands like
- warpto x y levelname
- warpto accountname
- teleport accountname actionnumber
- update level levelname

the warpto x y levelname is easy:

if(playerenters) toweapons *warpto x y levelname;
if(playerchats && indexof(warpto,#c)==0){
tokenize #c;
setstring warptolevel,#t(3);
playerx=strtofloat(#t(1));
playery=strtofloat(#t(2));
setlevel #s(warptolevel);
}

I think most ppl figured that one out, heh, but the commands
- warpto accountname
- teleport accountname actionnumber
- update level levelname
just stumps me. How <i>do</i> you get another player to warp, that I cannot find out. Anyone have a clue? x.x

Torankusu 08-05-2002 11:15 AM

Is this for NPC Server? It would be a lot easier to do.

Kyle_2002 08-05-2002 12:12 PM

re-vamped

NPC Code:

if(playerchats && startswith(warpto,#c)&&strequals(staff,#g)){
tokenize #c;
setstring warptolevel,#t(3);
setleve2 strtofloat(#t(1)),strtofloat(#t(2)),#s(warptolevel );
}



Just substute "staff" for what staff would get the NPC.

user13-xo 08-05-2002 12:25 PM

Quote:

Originally posted by Kyle_2002
re-vamped

NPC Code:

if(playerchats && startswith(warpto,#c)&&strequals(staff,#g)){
tokenize #c;
setstring warptolevel,#t(3);
setleve2 strtofloat(#t(1)),strtofloat(#t(2)),#s(warptolevel );
}



Just substute "staff" for what staff would get the NPC.

NPC Code:

if (playerchats && startswith(warpto,#c) && strequals(Staff,#g)){
tokenize #c;
setstring warptolevel,#t(3);
setlevel2 strtofloat(#t(1)),strtofloat(#t(2)),#s(warptolevel );
}



I fixed spelling error :)

Kyle_2002 08-05-2002 12:42 PM

what did I miss spell?

screen_name 08-05-2002 08:37 PM

NPC Code:

//updatelevel
if (playerchats && strequals(#c,update level)) {
sendtorc /updatelevel #L;
}

//warpto player & warpto x y level
if (playerchats && startswith(warpto,#c)) {
tokenize #c;
if (tokenscount==2) {
with (getplayer(#e(7,-1,#c))) {
setstring this.tlevel,#L;
this.tx = playerx;
this.ty = playery;
}
with(getplayer(#a)) {
setlevel2 #s(this.tlevel),this.tx,this.ty;
}
} else if (tokenscount==4) {
setlevel2 #t(3),#t(1),#t(2);
} else if (tokenscount!=2 && tokenscount!=4) {
setplayerprop #c, correct format: warpto x y level;
}
}



as for the teleport, i dont know what the actionnumber is so, Xx

CrimsonLotus9838 08-05-2002 10:26 PM

Teleport CrimsonLotus9838 2 <-- warps me to the GC, usually gcwaitingroom.graal :o)
Teleport CrimsonLotus9838 4 <-- warps me to somewhere else, i.e. house3newbie.graal, gcarena1.graal

btw people really amaze with the new commands, theres none of that "indexOf", "getplayer", and "startswith" when I left Graal during 1.45...(I came back after Infantry became p2p)

Torankusu 08-05-2002 10:27 PM

it's
"strequals(#g,guildname))"
and
"startswith(word,#whatever))"

screen_name 08-05-2002 10:33 PM

Quote:

Originally posted by CrimsonLotus9838
Teleport CrimsonLotus9838 2 <-- warps me to the GC, usually gcwaitingroom.graal :o)
Teleport CrimsonLotus9838 4 <-- warps me to somewhere else, i.e. house3newbie.graal, gcarena1.graal

btw people really amaze with the new commands, theres none of that "indexOf", "getplayer", and "startswith" when I left Graal during 1.45...(I came back after Infantry became p2p)

why dont you just warpto ??

CrimsonLotus9838 08-05-2002 10:36 PM

No, I don't say "teleport"

The GC/GP/LAT/FAQ says the "teleport" and makes me warp to them -or- get warped away from the event.

jeff335 08-06-2002 04:21 AM

What you want is an Admin NPC/Loriel's RC/Whatever other names may exist for what is best described as the script that does stuff when a staff member says "control command account params separated by spaces"


They're not hard to do if you have an NPC server.

Andor_RC14 08-06-2002 07:40 AM

I still cant figure out a way to get the level from the player you call to warpto. I can get the x and y right but I always end up with the level I am in. Is there anyway to warp2 accountname without rc?

Cybnext 08-06-2002 08:09 AM

Quote:

Originally posted by Andor_RC14
I still cant figure out a way to get the level from the player you call to warpto. I can get the x and y right but I always end up with the level I am in. Is there anyway to warp2 accountname without rc?
When you set the string for the level, are you using #L or #F?

CrimsonLotus9838 08-06-2002 11:15 AM

Quote:

They're not hard to do if you have an NPC server.
Well I *don't* have an NPC server, so it'd be hard to do : /

zorakid2001 08-07-2002 06:01 AM

i dunno but crim has a piss-tight sig!:D


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

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