Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-16-2006, 01:51 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
testplayer(mousex,mousey) problems

function onmousedown() {
mpid = testplayer(mousex,mousey);
checkkey();
if (this.key = 1) {
if (mpid > -1) {
drawmenu();
}
}
}

This currently works perfect if i click myself but only works on other players if they are on a gmap and not paused. How could i get around this?

[Edit]: Basic info - it is clientside, checkkey just returns whether the user is holding down shift.
Reply With Quote
  #2  
Old 05-16-2006, 02:21 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Only other solution is to go through players[], like
PHP Code:
for (plplayers) {
  if (
abs(mousex-pl.x)<=&& abs(mousey-pl.y)<=1) {
    ...
  }

Reply With Quote
  #3  
Old 05-16-2006, 02:41 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Does being paused render a player invisible so to say?
Reply With Quote
  #4  
Old 05-16-2006, 08:44 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Yes, if the player is paused they are not picked up with onwall/testplayer. So Invisible, in a sense.. except for (as stefan says) with players[]
Reply With Quote
  #5  
Old 05-16-2006, 11:06 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
isnt there a command or something like ispause or onPuased()
__________________
Deep into the Darkness peering...
Reply With Quote
  #6  
Old 05-17-2006, 03:31 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
NPC Code:
function activate_windowMode() {
for (i=0;i<playerscount;i++) {
if (mousex in |players[i].x+.5, players[i].x+2.5| && mousey in |players[i].y+1, players[i].y+3|) {
if (!(players[i].guild == "Events Team")) {
this.over_player = 1;

client.ET_playercontrol = players[i].account;
}
}
}
if (this.over_player == 1 || client.ET_playercontrol == this.findingp) {
.....
}



This is what I did for a script on Era. It's a bit sloppy, but it works.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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