Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   clicking other players (https://forums.graalonline.com/forums/showthread.php?t=62254)

talkingnoodle 11-13-2005 08:36 PM

clicking other players
 
im trying to make a profile system and when u click on urself or someone else their profile shows up...but i dont know how to make it when you click on other players to make it work

can someone give me like an example script on how to make something happen when u click on another online player

Lance 11-13-2005 08:57 PM

You'd probably want to start off with mousedown and testplayer.

talkingnoodle 11-13-2005 10:43 PM

can u gimme an example script...make it like use say2 or something

Fry 11-13-2005 11:10 PM

You could take a look at the Graal Wiki (http://wiki.graal.us/GScript sounds like it'd be useful for you) to get information about the particular functions or events.

ZeLpH_MyStiK 11-14-2005 12:06 AM

You want it so when you click on someone an action occurs, so you probably want to start with the mouse action, there are several mouse flags that detect mouse action such as
NPC Code:
mousedown


as Lance mentioned, then you probably want it to detect if a player is there so the final action doesnt just pop up out of nowhere even when there's no player there, so you can use
NPC Code:
testplayer(x,y)


that'll return the index of the player at x,y.
now depending on what you want the final action to be, you can use different commands, you can use say2 as you mentioned.

p.s. soo many run-ons

Skyld 11-14-2005 12:28 AM

Quote:

Originally Posted by ZeLpH_MyStiK
NPC Code:
testplayer(x,y)


that'll return the index of the player at x,y.

Is it not testplayer[x,y]?

Riot 11-14-2005 01:21 AM

Quote:

Originally Posted by Skyld
Is it not testplayer[x,y]?

Nope.
Quote:

Originally Posted by commands.rtf
testplayer( x, y ) the index of the player on position (x,y)

Quote:

Originally Posted by scriptfunctions_client.txt
testplayer(float, float) - returns integer


talkingnoodle 11-14-2005 04:27 AM

soo

if (mousedown){
if (testplayer(x,y){
blah?;
}
}

??

Deek2 11-14-2005 04:23 PM

You should probably use mousex and mousey.

Skyld 11-14-2005 06:15 PM

Quote:

Originally Posted by talkingnoodle
soo

if (mousedown){
if (testplayer(x,y){
blah?;
}
}

??

You should also close that testplayer() properly.

Also, if I remember correctly, testplayer returns the index of the found player, not true/false. You might want to modify your testplayer() check to support that.

Fry 11-14-2005 07:43 PM

It returns -1 if no player is found at the specified location, otherwise the player's id (I'm not absolutly sure whether it returns the level or server id, but if I remember correctly it's the server id), yes.

Ben just pointed out that level/server id might be confused with an id for a level/server or stuff, the correct names would be id for the player number for the entire server, and index for the player number local to the level. Although I consider these even more confusing.

Googi 11-14-2005 08:43 PM

http://img.photobucket.com/albums/v4...obsoletion.png

Bam! I just made all this GScript talk totally redundant.

napo_p2p 11-14-2005 09:44 PM

Quote:

Originally Posted by Googi
http://img.photobucket.com/albums/v4...obsoletion.png

Bam! I just made all this GScript talk totally redundant.

That won't do anything >_< (I'm pretty sure it's a custom profile system that he is talking about).

talkingnoodle 11-14-2005 10:32 PM

will someone just give me an example script !pissed!

Skyld 11-14-2005 10:43 PM

Quote:

Originally Posted by talkingnoodle
will someone just give me an example script !pissed!

Look. If you apply an ounce of knowledge, you can do this yourself.

Read the thread for the info we've given you.

talkingnoodle 11-14-2005 10:50 PM

-_-

ZeLpH_MyStiK 11-15-2005 01:41 AM

Quote:

Originally Posted by talkingnoodle
-_-

=\ we basically told you exactly what you need to make this, now just piece it all together. we're not going to give you an "example script" because we know you're just going to copy the entire thing -.-


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

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