Graal Forums

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

excaliber7388 08-05-2005 03:49 AM

setlevel?
 
if setlevel does not work online, what should i use instead?

Lance 08-05-2005 03:50 AM

Quote:

Originally Posted by excaliber7388
if setlevel does not work online, what should i use instead?

setlevel has been deprecated for years - use setlevel2, a serverside command.

excaliber7388 08-05-2005 05:27 AM

sorry...I am using setlevel2 :\ doesn't work online

Lance 08-05-2005 05:39 AM

Quote:

Originally Posted by excaliber7388
sorry...I am using setlevel2 :\ doesn't work online

Yes, it does. It's a serverside command.

excaliber7388 08-05-2005 04:27 PM

:\ it hasn't worked yet, and my server has been online for some time now

Fry 08-05-2005 04:33 PM

You are doing something wrong then. Maybe paste your code.

excaliber7388 08-05-2005 06:19 PM

here's the script i am currently using drwarp is my own gani for warping:
// NPC made by Excaliber (Manager)
//#CLIENTSIDE
if(playerenters){
toweapons Warp Rings/Warper1;
hidelocal}
if(weaponfired){
freezeplayer 2;
play thunder.wav;
setplayerdir 2;
setani drwarp,;
sleep .1;
for (i=0;i<21;i++) {
seteffect i/20,i/20,i/20,i/20;sleep .05}
{sleep 1;
seteffect 0,0,0,0;
setlevel2 warper.nw,31,31;}
}

-Ramirez- 08-05-2005 06:41 PM

Quote:

Originally Posted by Lance
It's a serverside command.

Quote:

Originally Posted by excaliber7388
//#CLIENTSIDE
setlevel2 warper.nw,31,31;


..................

LMAO @ post below
That's freaky... the same exact post time, haha.

Tolnaftate2004 08-05-2005 06:41 PM

Quote:

Originally Posted by Lance
It's a serverside command.

Quote:

Originally Posted by excaliber7388
//#CLIENTSIDE
...
toweapons Warp Rings/Warper1;
...
setlevel2 warper.nw,31,31;
...

:D @ above

You don't want toweapons with an NPC-Server.

PHP Code:

if (actionserverside) {
  if (
strequals(#p(0),warp)){
    
setlevel2 ...;
  }
}
//#CLIENTSIDE
...
triggeraction 0,0,serverside,WEAPON,warp;
... 


excaliber7388 08-06-2005 01:51 AM

i can't get it to work, try putting it directly into the script so i can see if im putting it in wrong :\

Maniaman 08-06-2005 03:23 AM

Quote:

Originally Posted by Tolnaftate2004
PHP Code:

if (actionserverside) {
  if (
strequals(#p(0),warp)){
    
setlevel2 ...;
  }
}
//#CLIENTSIDE
...
triggeraction 0,0,serverside,WEAPON,warp;
... 


Do not do this, it is very insecure.

setlevel2 works fine SERVERSIDE. You know, above the //#CLIENTSIDE line.

excaliber7388 08-06-2005 04:23 AM

ABOVE? AH HA! i'll try that thx =D i think i did already, but it can't hurt to try again :\

Zurkiba 08-06-2005 04:35 AM

I'd script my weapons/npcs in the NPC server o.o

ChibiChibiLuc 08-06-2005 04:50 PM

If it's below the //#CLIENTSIDE line, it's clientside.
If it's above the //#CLIENTSIDE line, it's serverside.
To do things in the serverside, you have to send a triggeraction.
The syntax is triggeraction 0,0,serverside,WEAPON NAME,params;
This calls (actionserverside).

And if you care about security..
It's only insecure if you're sending the level and x/y it's going to warp you to from the serverside.

NPC Code:
//INSECURE
if (actionserverside) {
if (strequals(#p(0),warp)) {
setlevel2 #p(1),strtofloat(#p(2)),strtofloat(#p(3));
}
}
//#CLIENTSIDE
if (weaponfired) {
triggeraction 0,0,serverside,Warper,warp,onlinestartlocal.nw,30, 30;
}



NPC Code:
//SECURE
if (actionserverside) {
if (strequals(#p(0),warp)) {
setlevel2 onlinestartlocal.nw,30,30;
}
}
//#CLIENTSIDE
if (weaponfired) {
triggeraction 0,0,serverside,Warper,warp;
}



With the first example, a hacker can modify the level and x/y it warps you to easily.
With the second example, they can't modify the level and x/y it warps you to.

excaliber7388 08-06-2005 08:08 PM

nope :\ will someone just enter this into the code i already have here, so i can set it up? thx.

edit: he gets it (delete a post so he's not double posting)


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

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