View Single Post
  #3  
Old 05-11-2007, 11:37 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Cherrykao View Post
Yadda yadda yadda
Well first of all, You need to define the variable on the client. Something like "client.vUnderRoof = false/true" will work fine.

Next, You need to do a loop to enable the code to detect the variable.

PHP Code:
timeout 0.05;

if (
timeout)
{
if (
client.vUnderRoof == true) {
  
vRoofI();
}
if (
client.vUnderRoof == false) {
  
vRoofV();
}

_______
Quote:
Originally Posted by DustyPorViva
Well that's a bad way to do it.
You should probably check the players.x/y in a timeout and when the player enters the coordinates of the roof, transparent, otherwise, return to normal.
I agree. Cherry, Why not check if the player's X and Y isn't in the NPC to undo it?

PHP Code:
// In timeout code
this.4// How many tiles the roof takes up, Horizontally
this.4// How many tiles the roof takes up, Vertically
if (!(playerx in |this.x, (this.x+this.w)|) && !(playery in |this.y, (this.y+this.h)|)
{
// Code to make roof opaque
} else {
// Code to make roof translucent

__________________
What signature? I see no signature?

Last edited by godofwarares; 05-11-2007 at 11:41 PM.. Reason: Code error!
Reply With Quote