Thread: setlevel?
View Single Post
  #14  
Old 08-06-2005, 04:50 PM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
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.
Reply With Quote