Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-08-2014, 03:01 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Clearing ALL clientr.vars

Is there a way to clear all clientr.vars? Without knowing all the clientr.vars set?

If there isn't some sort of "built in" way, how would I go about doing this in script? I don't even know where to start to grab random var names.

I need to wipe characters clean...
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 02-08-2014, 06:50 AM
Blah64 Blah64 is offline
Registered User
Blah64's Avatar
Join Date: Oct 2012
Posts: 20
Blah64 is on a distinguished road
serverside do something like:

NPC Code:
temp.clientrvars = findplayer(player.acccount).clientr.getdynamicvarn  ames();
for (temp.curvar :temp.clientrvars)
findplayer(player.account).clientr.(@temp.curvar) = null;

Reply With Quote
  #3  
Old 02-08-2014, 07:57 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
temp.pl = findplayer("xAndrewx");
for (temp.var: temp.pl.getstringkeys("clientr."))
  temp.pl.clientr.(@ temp.var) = null;
Is an alternative
__________________
Reply With Quote
  #4  
Old 02-08-2014, 01:29 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by Blah64 View Post
serverside do something like:

NPC Code:
temp.clientrvars = findplayer(player.acccount).clientr.getdynamicvarn  ames();
for (temp.curvar :temp.clientrvars)
findplayer(player.account).clientr.(@temp.curvar) = null;

This didn't remove any of them. temp.clientrvars is echoing "0";

Quote:
Originally Posted by xAndrewx View Post
HTML Code:
temp.pl = findplayer("xAndrewx");
for (temp.var: temp.pl.getstringkeys("clientr."))
  temp.pl.clientr.(@ temp.var) = null;
Is an alternative
This threw these errors:
PHP Code:
Script: Function sssssssssss.getstringkeys not found at line 185 in script of -System/CharCreate
Script
: Function sssssssssss.getstringkeys not found at line 189 in script of -System/CharCreate 

:/
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...



Last edited by sssssssssss; 02-08-2014 at 01:44 PM..
Reply With Quote
  #5  
Old 02-08-2014, 02:46 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 353
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
getstringkeys() is not a player function

you can however add it into a class which is joined to the player and it will accomplish the same thing -

PHP Code:
/*
    you probably want to add some callstack checks here to ensure that only permitted scripts are calling this function, or otherwise only join this class to the player before you want to reset them
*/
public function resetClientrVars()
  for(
temp.key getstringkeys("this.clientr."))
    
this.clientr.(@ temp.key) = ""
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #6  
Old 02-08-2014, 03:28 PM
100Zero100 100Zero100 is offline
Registered User
Join Date: Jul 2006
Posts: 31
100Zero100 is on a distinguished road
Are you attempting to do Blah64's suggestion in an onCreated on the serverside?

He put findplayer(player.account), which is redundant for "player." Either way, if you tried that in the onCreated, where there is no player scope, that would explain why it wouldn't work.

Doing:

PHP Code:
function onCreated() {
 
temp.findPlayer("Restraint").clientr.getDynamicVarNames();
 echo(
t.size());

in a serversided script, I got the echo "90" -- seems right to me.
__________________
Hi. I'm NaS!
Reply With Quote
  #7  
Old 02-08-2014, 06:56 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Ohh goodness.....
I had an extra "c" in player.account....

Blah's way works fine yes.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:41 PM.


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