Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Warpto System (https://forums.graalonline.com/forums/showthread.php?t=57726)

TESTRETIS 02-20-2005 10:54 PM

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"

Lance 02-20-2005 10:56 PM

1) The security also needs to be serverside, dude. -_-
2) KSI-GS

TESTRETIS 02-20-2005 11:02 PM

K, Ill shape it up a little bit.

TESTRETIS 02-21-2005 03:09 AM

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,;
}
}
}


falco10291029 02-21-2005 03:11 AM

k, sorry


All times are GMT +2. The time now is 07:24 AM.

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