Jump to content
MakeWebGames

Recommended Posts

Posted
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

Posted

Add each stat in its own hook

The way you want it you need to 1d another {each} but that wont work with the other 1 stat hook you need to add if condition to you code in both 2 stat hook and ur tpl to get what you want

Posted

Yeah each would have to be its own hook. I can look about adding support for multi-dimensional arrays but i would have to add it into loads of places to keep uniformity. It would be annoying to support it on one Hook and not all others.

  • Like 1
Posted
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.

Posted (edited)
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

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...