Jump to content
MakeWebGames

Return multiple profile stats


Sim

Recommended Posts

new hook("profileStat", function ($profile) {
  global $user;
  $test = 
    array("stat" => 99, 
      "text" => "Test"
    );
    
  $test = 
    array("stat" => 99, 
      "text" => "Test"
    );
  if ($user->id == $profile->info->U_id) {
    return $test;
  }
});

I been trying to return multiple profile stats set once. I know this choice obviously well but do so, but all attempts of 2d arrays/objects have failed. Anyone got any ideas? Maybe template change the variable? @Dayo

Link to comment
Share on other sites

15 hours ago, ags_cs4 said:

Add each stat in its own hook

That would be a lot of hooks, and not knowing the amount of hooks to add is even harder. 

I was trying to add a rap sheet to the profile by each success failed attempts to the profile stats.

Link to comment
Share on other sites

2 hours ago, ags_cs4 said:

Didn't understand what you said

I thought the screen shots would help you understand. Game owner can choose which mods to show failed/success/attempts to be added to profile stat.

But obviously it was an epic fail on my part not realizing I could not return an array. 🙂

Edited by Sim
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...