11.04.2009, 16:29
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...
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...
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;
}
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;
}