Players doesnt lose health indoors -
Khelif - 11.04.2009
How to make so that the players wouldnt lose health in certain interiors. their health would freeze when they enter an interior.
Re: Players doesnt lose health indoors -
Weirdosport - 11.04.2009
You'd need a timer running that loops every player to check if they're in an interior, and then it would set there health to full..
Re: Players doesnt lose health indoors -
Khelif - 11.04.2009
I have tried that already, is there any way without the timer?
Re: Players doesnt lose health indoors -
Mentis - 11.04.2009
What's wrong with using timers?
Re: Players doesnt lose health indoors -
Nero_3D - 11.04.2009
pawn Код:
SetPlayerHealth(playerid, Float:0x7F800000);
Re: Players doesnt lose health indoors -
Khelif - 11.04.2009
no I dont want timer, I want something like "Friendly fire" used in some gang scripts, cause with timers I still die no matter what I do
..I dont want players health to be set to full though, I want their health to freeze to whatever health they had when they entered interior.
Re: Players doesnt lose health indoors -
Nero_3D - 11.04.2009
Quote:
|
Originally Posted by Khelif
no I dont want timer, I want something like "Friendly fire" used in some gang scripts, cause with timers I still die no matter what I do
..I dont want players health to be set to full though, I want their health to freeze to whatever health they had when they entered interior.
|
how you want it, you need to use a fucking fast timer that you cant get killed by a minigun
Re: Players doesnt lose health indoors -
NigNog1 - 11.04.2009
Why use a timer?
Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(newinteriorid == 0)
{
SetPlayerTeam(playerid, NO_TEAM);
}else if (oldinteriorid == 0)
{
SetPlayerTeam(playerid, 1);
}
}
You could also set the players health to 10000, which is god mode, again without the need for a timer.
Re: Players doesnt lose health indoors -
Khelif - 11.04.2009
whatever fuck! I want freeeze health! no timers.. FAST timer would only lag my server!
when a player enter interior or area, his health will freeze, thats it! no TIMEERS!
Re: Players doesnt lose health indoors -
Outbreak - 11.04.2009
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 Код:
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;
}