Graal Forums

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

falco10291029 06-11-2004 06:14 PM

getplayer
 
I have had several instances that i would like to know how to use getplayer. I need this for a new wep i made that basically your guy teleports to the nearest player and then circles him while slashing him with the sword.

VeX_RaT_Boy 06-11-2004 06:15 PM

Read this before posting! http://forums.graal2001.com/forums/announcement.php?f=8

Dach 06-11-2004 06:19 PM

1 Attachment(s)
Read the documents in the attatchment. they are getting old and somewhat outdated, but they contain a wealth of knowledge I am sure you will find usefull. *note I put my updated commands.rtf in there too, since there was an old one... or something, this is a semi-long note*

Edit: Kjetil, the search function is still broke, so that doesn't do him any good, sad but true

VeX_RaT_Boy 06-11-2004 06:24 PM

Hm. Search Worked for me, but it only found this thread and the one Loriel closed, so I guess it's broken.

Dach 06-11-2004 06:30 PM

yeah, it only finds threads created after the update, which isn't all that usefull :\

osrs 06-11-2004 06:43 PM

It's not basically only getplayer, it envolves other things that you probably don't know how to work too; And to be honest it is not that easy for people that don't know much about scripting.

falco10291029 06-11-2004 11:00 PM

I know more about scripting than most people, its just the newer commands that go with servers and stuff that tend to confuse me, but i have been an NAT on a couple servers b4 the one im on now. Also i still just want to know how to use the getplayer command, its not very specific in the document...

Lance 06-11-2004 11:05 PM

Quote:

Originally Posted by falco10291029
I know more about scripting than most people

...*stabs*

Quote:

its just the newer commands that go with servers and stuff that tend to confuse me,
They aren't that new.

Quote:

but i have been an NAT on a couple servers b4 the one im on now.
This truly lends credibility to your first statement.

Quote:

Also i still just want to know how to use the getplayer command, its not very specific in the document...
Serverside:
NPC Code:
with(getplayer(accountname)) {


Python523 06-11-2004 11:08 PM

Quote:

Originally Posted by falco10291029
I know more about scripting than most people, its just the newer commands that go with servers and stuff that tend to confuse me, but i have been an NAT on a couple servers b4 the one im on now. Also i still just want to know how to use the getplayer command, its not very specific in the document...

new? NEW?! the npcserver has been around for 2-3 years. That excuse doesn't work anymore

Xecutor 06-11-2004 11:11 PM

npcserver.rtf is specific enough.

Malinko 06-11-2004 11:17 PM

I find it funny how five of those scripters above went insane when someone said it was "new" lmao.

Lance 06-11-2004 11:19 PM

Quote:

Originally Posted by Malinko
I find it funny how five of those scripters above went insane when someone said it was "new" lmao.

I find it funny that not only do you lack the ability to count but you also cannot distinguish between 'insane' and 'disgust'.

Malinko 06-11-2004 11:21 PM

Hey, I just skimmed over the post, not my fault I said five =P.

osrs 06-12-2004 02:25 AM

Quote:

Originally Posted by falco10291029
I know more about scripting than most people, its just the newer commands that go with servers and stuff that tend to confuse me, but i have been an NAT on a couple servers b4 the one im on now. Also i still just want to know how to use the getplayer command, its not very specific in the document...

It's syntax is like what Lance said.

NPC Code:

with(getplayer(osrs)){
setplayerprop #3,head1172.png;
}



Will change osrs's head! >_<
On your system, i would tell you to use getnearestplayers(); wich will return into an array of player's indexs. So get the first index (it's the nearest player) and get its account name,then use getplayer() to act on the specified player and do whatever you want.

Python523 06-12-2004 04:20 AM

Quote:

Originally Posted by osrs
It's syntax is like what Lance said.
On your system, i would tell you to use getnearestplayers(); wich will return into an array of player's indexs. So get the first index (it's the nearest player) and get its account name,then use getplayer() to act on the specified player and do whatever you want.

why use getplayer when you can do players[index]...

darkreign3 06-12-2004 04:22 AM

Iam not to great at Scripting ill just stick to my level makeing and Pixel art ;)

osrs 06-12-2004 07:38 AM

Quote:

Originally Posted by Python523
why use getplayer when you can do players[index]...

Hm, indeed.

EsCanavi 06-12-2004 08:23 AM

1 thing don't work Clientside try it server side command still not working
maybe cause its an offline mode command like few other but most of them work serverside/clientside

Lance 06-12-2004 09:37 AM

Quote:

Originally Posted by Malinko
Hey, I just skimmed over the post, not my fault I said five =P.

If you care enough to make a reply, you should care enough to read. Otherwise, you should withhold your extremely witty reply for a thread you actually pay attention to. I could also point out that whatever you post to this forum is, in fact, 'your fault'.

Quote:

Originally Posted by darkreign3
Iam not to great at Scripting ill just stick to my level makeing and Pixel art ;)

You know, I was going through this thread, and I didn't see your name in it. These are forums, not AIM. Don't spam.

falco10291029 06-12-2004 08:48 PM

Ok....its new to me cus for the past 2 years ive made single player adventure games so its new for me.....also with(index) is thhe correct format right not with(players[index])

Loriel 06-12-2004 09:35 PM

No, not really.

osrs 06-12-2004 09:44 PM

Quote:

Originally Posted by falco10291029
Ok....its new to me cus for the past 2 years ive made single player adventure games so its new for me.....also with(index) is thhe correct format right not with(players[index])

NPC Code:

with(players[index]){
//do action
}



There are a bunch of others players[index] variables too, not only .id;
Learning scripting is just an act of read, comprehend and test.

Loriel 06-12-2004 10:13 PM

... at which you apparently fail. with (players[i]).

osrs 06-12-2004 10:15 PM

Quote:

Originally Posted by Loriel
... at which you apparently fail. with (players[i]).

So will you put the .id outside the ()'s? :\

Loriel 06-12-2004 10:22 PM

Nope. :)

Python523 06-12-2004 11:20 PM

Quote:

Originally Posted by osrs
So will you put the .id outside the ()'s? :\

No. You will learn proper syntax though. :)

osrs 06-12-2004 11:58 PM

Sorry for my wrong information falco10291029, next time i will make sure to post correct things. :)
Quote:

Originally Posted by Python523
No. You will learn proper syntax though. :)

Living and learning... :)
And i knew it wasn't possible to put the .id outside the ()'s, i was being sarcastic.

falco10291029 06-13-2004 12:10 AM

ok yeh i testes after i posted and i was wrong so now i get it i still have some problems with such things but im learning by either geuss and chack or by looking at other scripts that i know what they do thewn seeing how they do it, and absorbing that info into my mind to use. When i first started scripting, i didnt even know how to make weps lol.


All times are GMT +2. The time now is 10:53 PM.

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