View Single Post
  #17  
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