Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Player Gender? (https://forums.graalonline.com/forums/showthread.php?t=77197)

xXziroXx 10-16-2007 08:18 AM

Player Gender?
 
Is there any way to read what gender the player has selected in his profile? I'm highly dependant on such a function right now, and player.ismale / player.isfemale always return true / false - no matter what's in their profile. And yes, I tried it both clientside and serverside.

xAndrewx 10-16-2007 08:49 AM

to set it

HTML Code:

player.setGender(gender);
to check it

HTML Code:

player.ismale - boolean
player.isfemale - boolean


Skyld 10-16-2007 09:24 AM

Read the question. :/
Quote:

Originally Posted by xAndrewx (Post 1353132)
to set it

HTML Code:

player.setGender(gender);
to check it

HTML Code:

player.ismale - boolean
player.isfemale - boolean


Quote:

Originally Posted by xXziroXx
Is there any way to read what gender the player has selected in his profile?

No, I do not believe there is.

zokemon 10-16-2007 12:04 PM

There should be like some $profile:: variables and such.

Twinny 10-16-2007 12:22 PM

Set a client variable to either male/female on login then add that to the profile vars.

xAndrewx 10-16-2007 06:58 PM

Quote:

Originally Posted by Skyld (Post 1353134)
Read the question. :/

just delete my post then... I didn't realise that he was referring to the profile var. calm down

zokemon 10-16-2007 10:40 PM

You can still delete it ^_^

xXziroXx 10-17-2007 08:42 AM

Quote:

Originally Posted by Twinny (Post 1353145)
Set a client variable to either male/female on login then add that to the profile vars.

Like I said... I dont want to SET it, I want to be able to READ what's in a players profile.

Stefan, is there a way to do so, or can you possibly add one?

Admins 10-17-2007 12:03 PM

I think you can do sendtext("lister","getprofile",player.account) and then get the data in function onReceiveText()

Googi 10-17-2007 07:53 PM

Just assume that it's male.

Crono 10-17-2007 08:02 PM

Quote:

Originally Posted by Googi (Post 1353332)
Just assume that it's male.

So true.

Inverness 10-17-2007 10:05 PM

There are no girls on The Internet.

xXziroXx 12-01-2007 02:51 PM

Quote:

Originally Posted by Stefan (Post 1353285)
I think you can do sendtext("lister","getprofile",player.account) and then get the data in function onReceiveText()

Cheers, that did the trick.

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
sendtext("lister""getprofile"player.account);
}

function 
onReceiveText(texttypetextoptionstextlines)
{
  if (
textoptions == "profile") {
    
// textlines[3].tokenize("=")[1]
    // -------------------
    // 'unknown' returns '-'
    // 'Male' returns 'male'
    // 'Female' returns 'female'
    
player.gender = (textlines[3].tokenize("=")[1] != "-" textlines[3].tokenize("=")[1] : "male");  // custom player. variable
  
}


EDIT: Hmm, that's interesting. Seems like ismale/isfemale now displays what you've selected in your profile? Did this get changed lately?
EDIT x2: Also, it appears as though when you select "unknown", ismale/isfemale returns what gender you previously had selected?

Crow 12-01-2007 03:18 PM

Quote:

Originally Posted by xXziroXx (Post 1361616)
EDIT: Hmm, that's interesting. Seems like ismale/isfemale now displays what you've selected in your profile? Did this get changed lately?
EDIT x2: Also, it appears as though when you select "unknown", ismale/isfemale returns what gender you previously had selected?

Not the case for me.

xXziroXx 12-01-2007 03:20 PM

Quote:

Originally Posted by Crow (Post 1361618)
Not the case for me.

I tried to remove all scripts from my account, reset it, and then do this in the Control-NPC upon login:

PHP Code:

function onActionPlayerOnline() {
  echo(
player.account SPC "gender:" SPC player.ismale "/" player.isfemale);


Every time it echoed what I had selected in my profile. And I know for a fact, that it didn't work 2 months ago when I last tried it, else I wouldn't have made this thread to begin with.

Crow 12-01-2007 04:10 PM

Maybe because its serverside? :o


All times are GMT +2. The time now is 11:11 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.