Scripting School
Would you like to react to this message? Create an account in a few clicks or log in to continue.

New to scripting? We want you!

Official Ventrilo: Host:Apollo.MaxFrag.net Port:3840
TestBed needs our help! Please donate a few dollars to keep it running here!
Have you mastered a specific part of GS2? Create a guide and help others!

You are not connected. Please login or register

Jimbo | Assignment 1

3 posters

Go down  Message [Page 1 of 1]

1Jimbo | Assignment 1 Empty Jimbo | Assignment 1 Fri May 06, 2011 2:28 am

Jimbo33



Code:
//#CLIENTSIDE
function onPlayerTouchsMe() {
  if (player.nick == "Jimbo") {
    this.chat = "Hi Jimbo!";
  }
  else {
    this.chat = "Hi stranger!";
  }
}

I used to know more GS2, but I quit Graal for more than a year and forgot most of it. I've decided to come back and subscribe to this scripting school since I now have taken 2 programming classes in college, and I want to compare and see if I can push GS2 further with what I have learn in class so far!

2Jimbo | Assignment 1 Empty Re: Jimbo | Assignment 1 Fri May 06, 2011 3:31 pm

David K?



This is good, the only thing I have to state is, I think you know that it only works by your nickname and once that is changed it will not work..

But maybe that wasn't your intention ^.^;

findPlayerbyCommunityName(community name)
findPlayer(account)

would work for your personal community name or account.

or even

findPlayerbyCommunityName(community name).nick
findPlayer(account).nick

would work for only you, and if you have that specific nick name.


Other then that, I think you will do fine with using what you already know in other classes!

3Jimbo | Assignment 1 Empty Re: Jimbo | Assignment 1 Sat May 07, 2011 12:14 pm

darthSaKi



I haven't played Graal much since pre 2010 I suppose. That's my qualifier for this question...

Are community names the names displayed for Graal##### accounts? Can community names be changed? For those with older accounts... would

findPlayerbyCommunityName(darthSaKi)

work if my (classic) account is darthSaKi?

4Jimbo | Assignment 1 Empty Re: Jimbo | Assignment 1 Sat May 07, 2011 2:08 pm

David K?



I get this confused sometimes when I'm stating it, because I too am a classic account.

Examples -
Account Number : Graal123456
Community Name: Pineapples

But yes, because our classic accounts are the same, we can use both findPlayer(); and findPlayerbyCommunityName();
however, you'd have to use quotes around the name.

findPlayerbyCommunityName("darthSaKi")

should work. ^.^;

5Jimbo | Assignment 1 Empty Re: Jimbo | Assignment 1 Sat May 07, 2011 2:13 pm

Jimbo33



I did know I was using nicknames, and that it wouldn't work when the nickname would be changed Wink

But thanks for the information you gave on community names and graal account numbers, I didn't know that!

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum