#Benzitczo PlayFab adventure.

1 messages · Page 1 of 1 (latest)

vital basin
iron meteor
#

Okay well here.

#

fogs yeah good idea hilo

jolly nexus
#

Try logging the value of result.Data["Staff"].Value

iron meteor
#

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.

jolly nexus
#

See if it outputs 1 or 0

unique echo
#

this is in the if branch, that says there is either no data or no "Staff " key, move it to the else

iron meteor
#

there setactive on and off

iron meteor
jolly nexus
#

What is this

iron meteor
jolly nexus
#

Lol

#

Log the value

#

Debug it

#

Debug.Log

iron meteor
#

oh.

#

forget.

#

Debug.Log(result.Data["Staff"].Value);

#

okay

#

test game no?

jolly nexus
#

Test now

#

See if it outputs 1 or 0

iron meteor
#

well.

gilded vine
#

I think you are tackling on a scope too big for your current knowledge

jolly nexus
#

Yeah clearly

iron meteor
jolly nexus
#

Hey it works

iron meteor
#

yeah but example need allow true and false set active.

gilded vine
#

You can just check which string it is then and convert it to a boolean

iron meteor
iron meteor
#

example staff.setactive(data...value);

jolly nexus
#

Yeah, bool.Parse should do the trick here.

#

Converts string to boolean

#

But the issue is with the code above

iron meteor
#

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());
    }) ;
}(```
jolly nexus
#

You have an if statement that you don't need

iron meteor
#

oh okay. and that complicated xd. sorry.

jolly nexus
#

Or, rather is in the wrong place

iron meteor
#

probably

#

bool.Parse(result.Data["Staff"].Value);

#

think?

jolly nexus
#

Yeah but the if statement screws it up

#

Remove it

iron meteor
#

ok? and? remove it? what line?

jolly nexus
#

The one where you check if the data is null

#

Remove it

#

Line 433

iron meteor
#

" if (result.Data == null || !result.Data.ContainsKey("Staff"))" remove?

jolly nexus
#

And the else, line 438

#

We'll do it simple

iron meteor
#

correct?

#

lol

jolly nexus
#

Good

#

Now, debug.log the whole line 435

iron meteor
#

back debug?

jolly nexus
#

Yes

iron meteor
#

ok done

#

start?

jolly nexus
#

Run the game again

iron meteor
#

yep

jolly nexus
#

See the console, there shouldn't be any errors

#

And it should say "False"

iron meteor
#

is okay.

#

nothing error

#

xd

jolly nexus
#

Then

bool isStaff = bool.Parse(result.Data["Staff"].Value);
yourObject.SetActive(isStaff);
#

Should be it now

iron meteor
#

Ok moment.

#

false change true

#

try

#

and start again

#

yeah work

#

lol

jolly nexus
#

Ahh finally

iron meteor
#

is correct spr2

#

exactly

#

you genius lol

#

yeah work

#

i see my think idea.

jolly nexus
#

If there are no other questions, someone archive this thread, apparently I can't, as I haven't created it

iron meteor
#

No problem relax again soon

#

thanks you.

gilded vine
#

Threads are archived automatically after some time

iron meteor
jolly nexus
#

Yeah but that one is 24h lmao

#

It's the default value

iron meteor
#

oh forger other last is final

#

there is intercatable

gilded vine
#

You gotta ping who started this one then. I'm not sure if the thread starter can archieve it, though

iron meteor
#

example staff.intercatable(istaff) no? (only number 1 to 0) or false and true?

jolly nexus
#

I'm not daring to ping a mod lmao

gilded vine
#

Ahh, I'm too scared to ping a mod

#

LOL

iron meteor
#

lol..

iron meteor
#

button.intercatable = true;

#

correct?

gilded vine
#

Yeah, I think that's something like that

jolly nexus
#

Yeah, but pass isStaff instead of true to make it depend on your authorization

#

b.isInteractable = isStaff

iron meteor
jolly nexus
#

For example

iron meteor
gilded vine
#

intercatable is a typo

iron meteor
#

D:

#

AH

#

fix

#

is interactable

#

sorry.

iron meteor
jolly nexus
#

Should work now!

iron meteor
#

yeah wait loading test

#

oh no

#

but broken same both why

#

need separated lol

jolly nexus
#

Show your code

iron meteor
jolly nexus
#

Should be good, unless you don't want it interactable if isMulti is true

iron meteor
#

but, staff and multi

#

= false done all same work

#

and staff true and multi false

#

why multi have true

#

both.

jolly nexus
#

Because your server values are like that

#

The code is good

iron meteor
#

maybe.

#

value probably.

#

see true and false. (Multi is multiplayer no cant button)

#

ah forget debug other

#

moment.

jolly nexus
#

Yeah exactly

#

You only debug isStaff, not isMulti

iron meteor
#

what.

#

staff is false?

#

Ah

#

i see.

#

probably wrong bad.

#

yeah ya is work

#

but crazy playfab troll

#

xd

#

thanks finally is work.

#

relax later soon.

#

you hero spr2 lol