11.04.2009, 14:17
How to make so that the players wouldnt lose health in certain interiors. their health would freeze when they enter an interior.
SetPlayerHealth(playerid, Float:0x7F800000);
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. |
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { if(newinteriorid == 0) { SetPlayerTeam(playerid, NO_TEAM); }else if (oldinteriorid == 0) { SetPlayerTeam(playerid, 1); } }
#define INT_TEAM 202
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;
}
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;
}
forward ChangeInt(playerid);
public ChangeInt(playerid)
{
SetPlayerTeam(playerid, playerid);
return 1;
}