#Benzitczo PlayFab adventure.
1 messages · Page 1 of 1 (latest)
Try logging the value of result.Data["Staff"].Value
it is explained there are keys and value for staff and false and true or also 0 and 1
For example that setactive deactivate and activate.
See if it outputs 1 or 0
this is in the if branch, that says there is either no data or no "Staff " key, move it to the else
there setactive on and off
probably.
What is this
setactive
well.
I think you are tackling on a scope too big for your current knowledge
Yeah clearly
Hey it works
yeah but example need allow true and false set active.
You can just check which string it is then and convert it to a boolean
exactly have setactive true and false
up imagen .
example staff.setactive(data...value);
Yeah, bool.Parse should do the trick here.
Converts string to boolean
But the issue is with the code above
try code: ``` public void GetUserData()
{
PlayFabClientAPI.GetUserData(new GetUserDataRequest()
{
// PlayFabId = myPlayFabeId,
Keys = null
}, result => {
Debug.Log("Got user data:");
if (result.Data == null || !result.Data.ContainsKey("Staff"))
Debug.Log(result.Data["Staff"].Value);
// Debug.Log("No Staff");
else Debug.Log("Staff Work: " + result.Data["Staff"].Value);
}, (error) => {
Debug.Log("Got error retrieving user data:");
Debug.Log(error.GenerateErrorReport());
}) ;
}(```
You have an if statement that you don't need
oh okay. and that complicated xd. sorry.
Or, rather is in the wrong place
" if (result.Data == null || !result.Data.ContainsKey("Staff"))" remove?
back debug?
Yes
Run the game again
yep
Then
bool isStaff = bool.Parse(result.Data["Staff"].Value);
yourObject.SetActive(isStaff);
Should be it now
Ahh finally
If there are no other questions, someone archive this thread, apparently I can't, as I haven't created it
Threads are archived automatically after some time
yeah. // thanks fogsight thanks you.
yep
oh forger other last is final
there is intercatable
You gotta ping who started this one then. I'm not sure if the thread starter can archieve it, though
example staff.intercatable(istaff) no? (only number 1 to 0) or false and true?
Last time I created one for testing, I could manually archive it myself
I'm not daring to ping a mod lmao
lol..
What do you mean by this?
Ah think is button?
button.intercatable = true;
correct?
Yeah, I think that's something like that
Yeah, but pass isStaff instead of true to make it depend on your authorization
b.isInteractable = isStaff
For example
intercatable is a typo
thanks
Should work now!
Show your code
Should be good, unless you don't want it interactable if isMulti is true
but, staff and multi
= false done all same work
and staff true and multi false
why multi have true
both.