19.09.2009, 20:07
Hi, i have seen it on other server, when you teleport to a place, all the vehicles and the player freeze while the objects load, please can you tell me how this is done?
Thanks.
Thanks.
//After the includes
forward FreezeTimer(playerid);
//When they teleport
TogglePlayerControllable(playerid,0);
SetTimerEx("FreezeTimer",3000,0,"d",playerid);
//When The Timer Stops
public FreezeTimer(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}
//Next to the other forward
forward VFreeze(vehicleid,Float:x,Float:y,Float:z);
//When they teleport
New Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
for(new v; v<750; v++)
{
if(GetVehicleModel(vehicleid)!=0)
{
New Float:vx,Float:vy, Float:vz;
GetVehiclePos(v,vx,vy,vz);
if((vx-x<50)&&(vy-y<50)&&(vz-z<50))
{
SetTimerEx("VFreeze",3000,0,"dfff",v,vx,vy,vz);
}
}
}
//The Timer ending
public VFreeze(vehicleid,Float:x,Float:y,Float:z)
{
for(new i;i<200;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i,vehicleid))return 0;
SetVehiclePos(vehicleid,x,y,z);
}
}
return 1;
}