Players doesnt lose health indoors
#10

No need for looping timers and all that....

All i did to get the same result was...

make a team for interiors. When a player enters an interior they get set onto a team, every player enering an interior getsset onto the same team...

So for example...

pawn Код:
#define INT_TEAM 202
pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
   if(newinteriorid > 0) //If the player enters an interior...
   {
     SetPlayerTeam(playerid, INT_TEAM);
   }

   if(newinteriorid == 0)//if the player leaves the interior and goes back outside...
   {
     SetPlayerTeam(playerid,playerid);//Unique because no player can have the same playerid... so they're all on sepperate teams
   }

return 1;
}
Even with this the players can stall take damage form toher players, but ONLY when leaving the interior.. So i added a 1 second timer to delay the team change from INT_TEAM to playerid. That then made it impossible to damage the player while inside or leaving an interior..

so then it would be...

pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
   if(newinteriorid > 0) //If the player enters an interior...
   {
     SetPlayerTeam(playerid, INT_TEAM);
   }

   if(newinteriorid == 0)
   {
    IntChangeDelay[playerid] = SetTimerEx("ChangeInt", 1000, 0, "i", playerid);
   }

return 1;
}
pawn Код:
forward ChangeInt(playerid);
public ChangeInt(playerid)
{
    SetPlayerTeam(playerid, playerid);
    return 1;
}
Reply


Messages In This Thread
Players doesnt lose health indoors - by Khelif - 11.04.2009, 14:17
Re: Players doesnt lose health indoors - by Weirdosport - 11.04.2009, 14:28
Re: Players doesnt lose health indoors - by Khelif - 11.04.2009, 14:32
Re: Players doesnt lose health indoors - by Mentis - 11.04.2009, 14:34
Re: Players doesnt lose health indoors - by Nero_3D - 11.04.2009, 14:57
Re: Players doesnt lose health indoors - by Khelif - 11.04.2009, 15:36
Re: Players doesnt lose health indoors - by Nero_3D - 11.04.2009, 15:55
Re: Players doesnt lose health indoors - by NigNog1 - 11.04.2009, 15:59
Re: Players doesnt lose health indoors - by Khelif - 11.04.2009, 16:05
Re: Players doesnt lose health indoors - by Outbreak - 11.04.2009, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)