View Single Post
  #8  
Old 07-31-2006, 03:18 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Gambet
PHP Code:
if (created)
  
setshape 1,32,32;

if (
actionheal) {
  
setstring clientr.hp,#s(clientr.hpmax);
  
set client.updateheart;
}
//#CLIENTSIDE
if ( created )
  
timeout=0.05;

if ( 
timeout ) {
  if ( 
playerx in |startxendx| && playery in |starty,endy| ) {
    unset 
client.disable;
    
enableweapons;
  } else {
    
set client.disable;
    
disableweapons;
   if ( 
strtofloat#s(clientr.hp) ) < strtofloat( #s(clientr.hpmax) ) ) {
    
triggeraction x+0.5,y+0.5,heal,;
    }
  }
  
timeout=0.05;

So you are triggering to the server to heal the player every 0.05 seconds. THATS WHERE MALS LAG COMES FROM :O

Now i wonder where eras comes from.. hmm

Here, just made this in a second - should work:

PHP Code:
function onPlayerTouchsMe() {
  
playersc 0;
  for (
i=0i<players.size(); i++) {
    
with (players[i]) {
      if (
player.x in |2030| && player.y in |2030|) { // You may want to change the position checks
        
playersc++;
      }
    }
  }
  if (
playersc >= 2) {
    
player.chat "There is currently two players in the spar!";
  } else {
    
player.chat "Sure, come on in";
  }

Maybe something like that?
Reply With Quote