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 04-05-2007, 09:08 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
testplayer() clientside

When did testplayer() not work on other players clientside?
I can only recieve the index 0 (myself) using the command..

I am totally sure it did work on other players before..

PHP Code:
//#CLIENTSIDE
function onMouseDown(button)
{
  if (
temp.button == "left") {
    
temp.testplayer(mousexmousey);
    if (
temp.> -1)
      
player.chat "player found: " temp." at:" SPC players[temp.j].x SPC players[temp.j].y;
    else
      if (
temp.== -1)
        
player.chat "no target found";
  }

This only works when I click myself..
And, testnpc() works fine on clientside, why's that..?
__________________

Last edited by Chompy; 04-05-2007 at 10:31 PM..
Reply With Quote
  #2  
Old 04-05-2007, 11:53 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
This may sound stupid but are there other players on the level?
Reply With Quote
  #3  
Old 04-05-2007, 11:58 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Rapidwolve View Post
This may sound stupid but are there other players on the level?
Uhm, yes... Was about 8 players in the level..
__________________
Reply With Quote
  #4  
Old 04-06-2007, 06:09 AM
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 checks if they can be hit I believe. I found it didn't work if they were paused and possibly didn't work when they were in a non-pk level. Could try this

PHP Code:
function findmouseplayer()
{
  for (
plplayers
  {
    if (
pl.x in |mousexmousex+2|)
    {
      if (
pl.y in |mouseymousey+2|)
      {
        
temp.find.add(pl.account);
        
//break if you only want 1
      
}
    }
  }
  return 
temp.find;

Reply With Quote
  #5  
Old 04-06-2007, 07:42 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Yeah. I had that problem on Era which was weird. Sometimes it didn't detect anyone, other times it did.
I just used this
PHP Code:
if (leftmousebutton)
  for (
temp.foundPlayerplayers)
    if (
temp.foundPlayer.x in |mousex 3mousex 3| && temp.foundPlayer.y in |mousey 3mousey 3|)
    {
      
cTARGET.text temp.foundPlayer.account;   
      break;
    } 
Reply With Quote
  #6  
Old 04-06-2007, 09:39 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Twinny View Post
Testplayer checks if they can be hit I believe. I found it didn't work if they were paused and possibly didn't work when they were in a non-pk level. Could try this
-Snip-
I've been told that testplayer() doesn't work in No-PK zones, so I can confirm that.
Reply With Quote
  #7  
Old 04-06-2007, 03:17 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Hmm, that's why it doesn't work..
Well, I've been working on this name system, and then suddenly testPlayer() weren't working.. hmm

Well, I gotta use other methods to get it to working then :]

Thanks guys
__________________
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:45 AM.


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