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 02-20-2005, 10:54 PM
TESTRETIS TESTRETIS is offline
Zvarri!
TESTRETIS's Avatar
Join Date: Oct 2003
Posts: 970
TESTRETIS has a spectacular aura about
Warpto System

I based this off Shifter's..I think he made the original one? Anyway, I guess you could say I "re-made" it but now it doesn't require access to a DBNPC to change the permissions, just need to edit the accounts that are in each section. Feel free to use this on your server as you wish, you may edit it to your own will, just be sure to give me proper credit whenever. Not the GREATEST scripting in the world, but it works. Enjoy.

Also, for editing accounts, just add on an additional or (||) statement to each account. This should be mainly given to Non-RC Staff members.

NPC Code:

//NPC By Ben Rain
if (actionserverside) {
if (strequals(#p(0),ul)) {
sendtorc /updatelevel #p(1);
setplayerprop #c,Sucessful!;
}
if (strequals(#p(0),warpto)) {
setlevel2 #p(3),strtofloat(#p(1)),strtofloat(#p(2));
}
if (strequals(#p(0),warptoplayer)) {
with (getplayer(#p(1))) {
setstring this.level,#F;
this.x = playerx;
this.y = playery; }
setlevel2 #s(this.level),this.x,this.y;
}
}


//#CLIENTSIDE
if (playerchats&&startswith(warpto,#c)) {
tokenize #c;
if (tokenscount>2) {
if (strequals(#a,account1)||strequals(#a,account2)) {
triggeraction 0,0,serverside,Staff/Warpto,warpto,#v(strtofloat(#t(1))),#v(strtofloat( #t(2))),#t(3);
}
}
else if (tokenscount=2) {
if (strequals(#a,account1)||strequals(#a,account2)) {
triggeraction 0,0,serverside,Staff/Warpto,warptoplayer,#t(1)
}
}
}
if (playerchats&&strequals(#c,update level)) {
if (strequals(#a,account1)||strequals(#a,account2)) {
triggeraction 0,0,serverside,Staff/Warpto,ul,#L,;
}
}



Note: Players will still get message such as "Not authorized to warpto"
Reply With Quote
  #2  
Old 02-20-2005, 10:56 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
1) The security also needs to be serverside, dude. -_-
2) KSI-GS
Reply With Quote
  #3  
Old 02-20-2005, 11:02 PM
TESTRETIS TESTRETIS is offline
Zvarri!
TESTRETIS's Avatar
Join Date: Oct 2003
Posts: 970
TESTRETIS has a spectacular aura about
K, Ill shape it up a little bit.
Reply With Quote
  #4  
Old 02-21-2005, 03:09 AM
TESTRETIS TESTRETIS is offline
Zvarri!
TESTRETIS's Avatar
Join Date: Oct 2003
Posts: 970
TESTRETIS has a spectacular aura about
I already fixed it up before falco, Just didnt have time to post it.

Anyway Here it is, fixed up
NPC Code:

//NPC by Ben Rain

if (actionserverside) {
if (strequals(#p(0),requestList)) {
setstring this.accounts,acc1,acc2,; // Accounts here
triggeraction 0,0,clientside,Staff/Warpto,"#s(this.accounts)";
}
if (lindexof(#a,this.accounts) > -1) {
if (strequals(#p(0),ul)) {
sendtorc /updatelevel #p(1);
setplayerprop #c,Sucessful!;
}
if (strequals(#p(0),warpto)) {
setlevel2 #p(3),strtofloat(#p(1)),strtofloat(#p(2));
}
if (strequals(#p(0),warptoplayer)) {
with (getplayer(#p(1))) {
setstring this.level,#F;
this.x = playerx;
this.y = playery;
}
setlevel2 #s(this.level),this.x,this.y;
}
}
}

//#CLIENTSIDE
if (created) triggeraction 0,0,serverside,Staff/Warpto,requestList;
if (actionclientside) setstring this.accounts,#p(0);
if (playerchats) {
if (startswith(warpto,#c)) {
tokenize #c;
if (tokenscount > 2) {
if (lindexof(#a,this.accounts) > -1) {
triggeraction 0,0,serverside,Staff/Warpto,warpto,#t(1),#t(2),#t(3);
}
}
else if (tokenscount == 2) {
if (lindexof(#a,this.accounts) > -1) {
triggeraction 0,0,serverside,Staff/Warpto,warptoplayer,#t(1);
}
}
}
else if (strequals(#c,update level)) {
if (lindexof(this.accounts,#a) > -1) {
triggeraction 0,0,serverside,Staff/Warpto,ul,#L,;
}
}
}

Reply With Quote
  #5  
Old 02-21-2005, 03:11 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
k, sorry
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
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 03:44 PM.


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