/prison cmd owned
#1

Alright so on my RP server we for sure have a /prison CMD which sets a said person into a prison cell for breaking rules.
The problem is, whenever we do that the said person falls through the ground because the prison interior takes 1 second to be displayed. Same if you /enter the prison. You have a 80% chance of falling through the ground because the whole prison appears 1 sec later.

Код:
			else if(IsPlayerInRangeOfPoint(playerid,3.0,201.3625,1869.4546,13.1406)) //Prison
			{
			    SetPlayerInterior(playerid, 1);
			    SetPlayerPos(playerid, 1804.14,-1576.62,1637.71);
                GameTextForPlayer(playerid, "~w~Detention Facility", 5000, 1);
                SetPlayerFacingAngle(playerid, 90.0000);
                SetCameraBehindPlayer(playerid);
			}
This is just a part of the enter command. I have no idea why the whole prison itself takes a seocnd to load though.


Any ideas?
Reply
#2

Put this :

pawn Код:
TogglePlayerControllable(playerid, 0);
SetTimerEx("Unfreeze", 1500, true, "i", playerid);

forward Unfreeze(playerid);
public Unfreeze(playerid)
{
  TogglePlayerControllable(playerid, 1);
  return 1;
}
Reply
#3

Objects need to stream in, and that would take some time. What about freezing the player and setting a 2-second timer to unfreeze him?
Reply
#4

Thanks for the code example and your help guys.

Just tried it. Works "ok" but whenever a person starts moving he gets auto-unfrozen after the timer ends somehow. So every 1 sec a person gets kinda half stuck and repeatly unfrozen lol.


(yup just tried again, somehow it seems that the timer keeps repeating itself)
Reply
#5

replace viruzz's line with this one:
Код:
SetTimerEx("Unfreeze", 1500, false, "i", playerid);
Reply
#6

Done that before you posted and it worked.

Thanks though, you would've fixed my problem now :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)