Results 1 to 10 of 35

Thread: Quick questions thread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Is there a way to print/display a structure of an object (self, level etc.) like it is made for example in PHP (vardump()/print_r()) ?

  2. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Whiskas View Post
    Is there a way to print/display a structure of an object (self, level etc.) like it is made for example in PHP (vardump()/print_r()) ?
    Not directly: https://killtube.org/showthread.php?...5105#post15105

  3. The Following User Says Thank You to serthy For This Useful Post:

    Ni3ls (14th February 2017)

  4. #3
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Quote Originally Posted by serthy View Post
    I believe that you misunderstood my question. For example: I used "magic function" on player object and I would like to get back something like this:
    PHP Code:
    Object (
        [
    name] => "Whiskas"
        
    [pers] => Array
            (
                [
    team] => "spectator"
                
    [weapon] => undefinded
                
    [savedmodel] => undefined
                
    [skipserverinfo] => undefined
            
    )
        [
    score] => 6
        
    [death] => 2
        
    [sessionstate] => "playing"
        
    [maxhealth] => 100
        
    [health] => 100
        
    [friendlydamage] => undefined
        
    [statusicon] => ""

    But with every variable that is "binded" to that structure. I would like to know what variables does level/player have.
    Last edited by Whiskas; 14th February 2017 at 17:35.

  5. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Ahh, got it

    iirc libcod also has GetArrayKeys() implemented, that works like the CoD4 version (see script reference for that) but this would work only for arrays, not objects..)

  6. The Following User Says Thank You to serthy For This Useful Post:

    Whiskas (14th February 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •