Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-18-2006, 09:15 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
saving multidimensional arrays to the player

PHP Code:
function onCreated() {
  
with (findplayer("Dach")) {
    
template={2,0,10,4,18,"body.png","head0.png","sword1.png","shield1.png"};
    
player.outfits = new[5];
    for (
i=0;i<5;i++){
      
player.outfits[i] = i;
    }
  }
}
//#CLIENTSIDE 
PHP Code:
function onCreated() {
  
with (findplayer("Dach")) {
    
template={2,0,10,4,18,"body.png","head0.png","sword1.png","shield1.png"};
    
client.outfits = new[5][9];
    for (
i=0;i<5;i++)
      for (
j=0;j<9;j++) 
        
client.outfits[i][j] = template[i];
  }
}
//#CLIENTSIDE 
Both of the above algorithms using client. clientr. or player. prefixes will store only '0' to the array (storing in single and two dimensional, respectively). This is reading from the player attributes, if you echo them they will look okay. Using the client. prefix from clientside does the same. However, the next algorithm will work just fine with the prefixes. It does not seem to affect anything else, just prefixes associated with the player object.

PHP Code:
function onCreated() {
  
with (findplayer("Dach")) {
    
template={2,0,10,4,18,"body.png","head0.png","sword1.png","shield1.png"};
    
client.outfits null;
    for (
i=0;i<5;i++)
      
client.outfits.add(template);
  }
}
//#CLIENTSIDE 
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
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 07:17 AM.


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