/prison cmd owned - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /prison cmd owned (
/showthread.php?tid=188157)
/prison cmd owned -
EthanR - 06.11.2010
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?
Re: /prison cmd owned -
ViruZZzZ_ChiLLL - 06.11.2010
Put this :
pawn Код:
TogglePlayerControllable(playerid, 0);
SetTimerEx("Unfreeze", 1500, true, "i", playerid);
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
Re: /prison cmd owned -
Jochemd - 06.11.2010
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?
AW: /prison cmd owned -
EthanR - 06.11.2010
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)
Re: /prison cmd owned -
Mike_Peterson - 06.11.2010
replace viruzz's line with this one:
Код:
SetTimerEx("Unfreeze", 1500, false, "i", playerid);
AW: /prison cmd owned -
EthanR - 06.11.2010
Done that before you posted and it worked.
Thanks though, you would've fixed my problem now :P