Graal Forums

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

ArushenP2P 02-19-2006 03:05 AM

Help
 
NPC Code:

//#CLIENTSIDE

if (created || timeout) {timeout=.05;} //infinite loop

if (timeout) {
if (mousex in |playerx,playerx+2| && mousey in |playery,playery+2|) {
showcharprop #a;
}
}



I need it to be so it can show the players account not my account, you know when you put your mouse over them it shows there account.

Someone please help me :\

screen_name 02-19-2006 03:06 AM

Wow...

You work on a server?

talkingnoodle 02-19-2006 03:15 AM

Quote:

Originally Posted by screen_name
Wow...

You work on a server?

IM LOLING IN REAL LIFE

and...

wat is this supposed to be?

Chicken_l33t 02-19-2006 03:27 AM

//#CLIENTSIDE
if (created){
timeout = .05;
}

if (timeout){
if (mousex in |playercraphere,playercraphere| && mousey in|playercraphere,playercraphere|){
setplayerprop #c,#a; // #c is the players chat and #a is account
}
timeout = .05;
}

// You have to have timeout = .05; inside the timeout itself for it to loop.

Ohh, and if this is to test another player and not yourself you're best using testplayer(x,y);

Ajira 02-19-2006 03:30 AM

Quote:

Originally Posted by Chicken_l33t
//#CLIENTSIDE
if (created){
timeout = .05;
}

if (timeout){
if (mousex in |playercraphere,playercraphere| && mousey in|playercraphere,playercraphere|){
setplayerprop #c,#a; // #c is the players chat and #a is account
}
timeout = .05;
}

// You have to have timeout = .05; inside the timeout itself for it to loop.

Ohh, and if this is to test another player and not yourself you're best using testplayer(x,y);

Stop giving bad advice...
That will still work but it is bad scripting.

Anyway, you need to iterate through 'playerscount' and check the mousex/y in players[index].x/y. Then display the account using #a(index).

Chicken_l33t 02-19-2006 03:40 AM

Umm, I was fixing his script not giving him a whole new one. It's not bad advice becaue I was fixing what he already had and testplayer(x,y) returns the index of the player so you don't have to do what you said.

Don't be such a prick aswell. Wee, good advice.

ZeLpH_MyStiK 02-19-2006 09:22 AM

Quote:

Originally Posted by Chicken_l33t
Umm, I was fixing his script not giving him a whole new one. It's not bad advice becaue I was fixing what he already had and testplayer(x,y) returns the index of the player so you don't have to do what you said.

Don't be such a prick aswell. Wee, good advice.

I don't see much of a difference between your script and the thread-maker's. But it is a bit of an improvement.
Also last time I checked, testplayer index does not work on clientside anymore. It returns 0 for yourself, or it returns -1. Anyone care to debate?
Nonetheless, iterating through all the players in a level using a for loop, then checking coordinates using players[index].xy, then using #a(index) to display the account name will work.

ApothiX 02-20-2006 05:41 AM

Quote:

Originally Posted by Ajira
Stop giving bad advice...
That will still work but it is bad scripting.

How is it bad scripting?

Chicken_l33t 02-20-2006 06:14 AM

Quote:

I don't see much of a difference between your script and the thread-maker's. But it is a bit of an improvement.
Also last time I checked, testplayer index does not work on clientside anymore. It returns 0 for yourself, or it returns -1. Anyone care to debate?
No, it does work and it returns the players index. For some reason though it only seems to work on the gmap, but you're right though about the better way to do it.


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

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