Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 05-25-2010, 05:18 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Jiroxys7 View Post
I believe im fairly familiar with using the serverside <=> clientside stuff. didnt know the difference between temp.var and this.var though =3

so if i want to create an important clientr.var, i should do something like this?:

example:
<snip>

clientr.num should equal 3.

now, I'm wondering though, are people able to hack and edit this.num1 and this.num2 to change the outcome of clientr.num? or is it just harder to hack compared to client.vars?
The values of this.num1 and this.num2 are being passed as parameters, not the actual variables themselves. It would look like this:

PHP Code:
function onActionServerSide(cmdp1p2) { // you can call these whatever you want
  
if (temp.cmd == "calc_math") {
    
// p1 and p2 hold the values 1 and 2
    
    
doMakeMathVar_S(temp.p1temp.p2);
  }
}

function 
doMakeMathVar_S(num1num2){ // again, call these parameters whatever you want
   
clientr.num temp.num1 temp.num2// parameters are temp.vars -- only accessible within the function block
}

//#CLIENTSIDE

function doMakeMathVar_C() {
  
// There's really no reason to use this.vars here because you 
  // only need them  within this function block
  // for sake of learning, I'll leave it as you had it
  
  
this.num1 1;
  
this.num2 2;
  
triggerServer("weapon"this.name"calc_math"this.num1this.num2);

__________________
Reply With Quote
 


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 12:26 PM.


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