View Single Post
  #1  
Old 03-27-2014, 03:39 PM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
Hide under bush bug?

When a player hides under a bush and then changes levels, they become invisible to other players. If a player is hidden under a bush and another player walks into that level, the player hidden under the bush is invisible to then.

The issue seems to be that the players ani isn't being properly set on the serverside. When a player is hidden on a bush, their ani is still "carry" or "carrystill" serverside, while clientside it is "hidden" or "hiddenstill". The following script fixed the problem.

PHP Code:
function onActionServerside() {
  if(
params[0] == "fixhidden") {
    
// Ensure the players gani is changed even after fix applied
    
player.ani "hidden";
    
player.ani "hiddenstill";
  }elseif(
params[0] == "checkhidden") {
    
// Need to do with all players in level, otherwise if a player
    // enters a level where someone is already hiding under a bush,
    // they won't be able to see that player.
    
for(temp.pl:players) {
      
pl.triggerclient("gui",this.name,"checkhidden");
    }
  }
}


//#CLIENTSIDE
function onPlayerEnters(){
  
triggerserver("gui",this.name,"checkhidden");
}

function 
onActionClientside() {
  if(
params[0] == "checkhidden") {
    
// Gani is recognized properly clientisde
    
if(player.ani == "hidden" || player.ani == "hiddenstill") {
      
triggerserver("gui",this.name,"fixhidden");
    }
  }

I'm wondering if this is just a problem on UN or if it is a problem everywhere.
__________________
-Ph8
Reply With Quote