Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-14-2014, 08:08 PM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
Ah, now it shows up when I changed it to 1. So how would I set a clientr variable to the number 0 then? Or should I just get it to detect that there's none and have a default conditional to go to if that's the case?

As clarification I'm trying to get it to actively read the clientr variable so that the player can keep track of how many trees he's cut down. But when the clientr variable is set to 0, it can't effectively keep track of it. Are clientr variables 0 by default? Is 0 the equivelant of null?
Reply With Quote
  #2  
Old 10-14-2014, 08:13 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Struggler View Post
Ah, now it shows up when I changed it to 1. So how would I set a clientr variable to the number 0 then? Or should I just get it to detect that there's none and have a default conditional to go to if that's the case?
You can always set it to 0, in the end when you want to display it, it will show 0 anyway. 0 is equal to NULL, you can also try echo(player.clientr.randomlettershere) without creating that flag in the first place, it will also return 0
__________________
MEEP!
Reply With Quote
  #3  
Old 10-14-2014, 08:16 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Quote:
Originally Posted by Struggler View Post
Ah, now it shows up when I changed it to 1. So how would I set a clientr variable to the number 0 then? Or should I just get it to detect that there's none and have a default conditional to go to if that's the case?
Depends, I'm still trying to figure out what your script is supposed to accomplish.

PHP Code:
function onActionServerside(){
  if (
params[0] == "updatevars"){
    
player.clientr.treescut true;
    echo(
player.clientr.treescut);
  }
}

//#CLIENTSIDE
function onCreated(){
  if (
player.clientr.treescut == false) { //Your variable will have to be false to trigger serverside again
    
triggerserver("gui"this.name"updatevars");
  }

__________________
Reply With Quote
Reply


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 11:30 PM.


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