01.04.2011, 21:15
How can i make when player teleports to a place they will be frozen until the objects completes loading ?
forward PlayerEnterInt(playerid);
public PlayerEnterInt(playerid) // THE FUNCTION
{
TogglePlayerControllable(playerid, 0);
SetTimer("PlayerEnterIntT", 3000, 0);
}
forward PlayerEnterIntT(playerid);
public PlayerEnterIntT(playerid) // THE TIMER
{
TogglePlayerControllable(playerid, 1);
}
PlayerEnterInt(playerid);
CMD:das(playerid, params[])
{
SetPlayerInterior(playerid,0);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,404.1312,2452.7603,16.5000);
PlayerEnterInt(playerid);
SetPlayerFacingAngle(playerid,357.2612);
SendClientMessage(playerid,0xFF9900AA,"You had teleported to Desert Air Strip!");
return 1;
}
stock PlayerEnterInt(playerid) // THE FUNCTION
{
TogglePlayerControllable(playerid, false);
SetTimerEx("PlayerEnterIntT", 3000, false, "d", playerid);
}
forward PlayerEnterIntT(playerid);
public PlayerEnterIntT(playerid) // THE TIMER
{
TogglePlayerControllable(playerid, true);
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 0)
{
FreezeInt(playerid);
}
return 1;
}
stock FreezeInt(playerid)
{
TogglePlayerControllable(playerid, false);
SetTimerEx("UnfreezeInt", 3000, false, "i", playerid);
return 1;
}
forward UnfreezeInt(playerid);
public UnfreezeInt(playerid)
{
return TogglePlayerControllable(playerid, true);
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 0)
{
TogglePlayerControllable(playerid, false);
SetTimerEx("UnfreezeInt", 3000, false, "i", playerid);
}
return 1;
}