View Single Post
  #6  
Old 08-12-2008, 04:48 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Having temp. makes variable lookup faster.
PHP Code:
public function clientfunction(fobjfnamep0p1p2p3p4p5p6p7p8p9) {
  
triggerclient("gui"this.name"clientfunction"temp.fobjtemp.fnametemp.p0temp.p1temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
  
waitfor(this"ClientFunctionEnd"5);
  
temp.out thiso.cfreturn;
  
thiso.cfreturn null;
  return 
temp.out;
}
public function 
clientfunction2(fobjfnamep0p1p2p3p4p5p6p7p8p9) {
  
triggerclient("gui"this.name"clientfunction2"temp.fobjtemp.fnametemp.p0temp.p1temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
}
public function 
clientfunction3(wtimefobjfnamep0p1p2p3p4p5p6p7p8p9) {
  
triggerclient("gui"this.name"clientfunction"temp.fobjtemp.fnametemp.p0temp.p1temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
  
waitfor(this"ClientFunctionEnd"temp.wtime);
  
temp.out thiso.cfreturn;
  
thiso.cfreturn null;
  return 
temp.out;
}
public function 
npcfunction(p0p1p2p3p4p5p6p7p8p9) {
  
temp.obj findlevel(temp.p0);
  for (
temp.iobj.npcs) {
    if (
temp.i.id == temp.p1) {
      return 
temp.i.(@ temp.p2)(temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
    }
  }
}
function 
onActionServerSide() {
  if (
params[0] == "end") {
    
thiso.cfreturn params[1];
    
trigger("ClientFunctionEnd"null);
  }
  else if (
params[0] == "serverfunction") {    
    if (
params[1] != null)
      
triggerclient("gui"this.name"end"makevar(params[1] @ "." params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]));
    else 
      
triggerclient("gui"this.name"end"makevar(params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]));
  }
  else if (
params[0] == "serverfunction2") {
    if (
params[1] != null)
      
makevar(params[1] @ "." params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]);
    else 
      
makevar(params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]);
  }
}
//#CLIENTSIDE
function onActionClientSide() {
  if (
params[0] == "end") {
    
thiso.sfreturn params[1];
    
trigger("ServerFunctionEnd"null);
  }
  else if (
params[0] == "clientfunction") {    
    if (
params[1] != null)
      
triggerserver("gui"this.name"end"makevar(params[1] @ "." params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]));
    else 
      
triggerserver("gui"this.name"end"makevar(params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]));
  }
  else if (
params[0] == "clientfunction2") {
    if (
params[1] != null)
      
makevar(params[1] @ "." params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]);
    else 
      
makevar(params[2])(params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]);
  }
}
public function 
npcfunction(p0p1p2p3p4p5p6p7p8p9) {
  return 
findnpcbyid(temp.p0).(@ temp.p1)(temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
}
public function 
serverfunction(fobjfnamep0p1p2p3p4p5p6p7p8p9) {
  
triggerserver("gui"this.name"serverfunction"temp.fobjtemp.fnametemp.p0temp.p1temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
  
waitfor(this"ServerFunctionEnd"5);
  
temp.out thiso.sfreturn;
  
thiso.sfreturn null;
  return 
temp.out;
}
public function 
serverfunction2(fobjfnamep0p1p2p3p4p5p6p7p8p9) {
  
triggerserver("gui"this.name"serverfunction2"temp.fobjtemp.fnametemp.p0temp.p1temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
}
public function 
serverfunction3(wtimefobjfnamep0p1p2p3p4p5p6p7p8p9) {
  
triggerserver("gui"this.name"serverfunction"temp.fobjtemp.fnametemp.p0temp.p1temp.p2temp.p3temp.p4temp.p5temp.p6temp.p7temp.p8temp.p9);
  
waitfor(this"ServerFunctionEnd"temp.wtime);
  
temp.out thiso.sfreturn;
  
thiso.sfreturn null;
  return 
temp.out;

__________________
Reply With Quote