SA-MP Forums Archive
Help me please - 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)
+--- Thread: Help me please (/showthread.php?tid=447679)



Help me please - TranquiliZed - 01.07.2013

I created a door at LSPD with Streamer and it enter the interior but when you enter it or exit it you you become frozen... And I cant figure out how to fix it. Will post code on request


Re: Help me please - AIped - 01.07.2013

try TogglePlayerControllable(playerid,1);


Re: Help me please - DobbysGamertag - 01.07.2013

pawn Код:
TogglePlayerControllable(playerid,0);
or anything similar in the script?


Re: Help me please - TranquiliZed - 01.07.2013

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
pawn Код:
TogglePlayerControllable(playerid,0);
or anything similar in the script?
Код:
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,246.8240,62.6125,1003.6406);
TogglePlayerControllable(playerid, 0);



Re: Help me please - Cjgogo - 01.07.2013

Show us the code.


Re: Help me please - TranquiliZed - 01.07.2013

Код:
CMD:enter(playerid, params[])
{
	for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
	    {
	        if(DoorInfo[idx][dCInt])
	        {
	            GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
		TogglePlayerControllable(playerid, 0);
	            SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
	            PlayerInfo[playerid][pSpawnFreeze] = 1;
	        }
	        SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
	        SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
	        SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
	        SetCameraBehindPlayer(playerid);
	        SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
	        return 1;
	    }
		if(IsPlayerInRangeOfPoint(playerid,8.0,1554.6433,-1675.7488,16.1953)) //LSPD
		{
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerInterior(playerid,6);
			SetPlayerPos(playerid,246.8240,62.6125,1003.6406);
			TogglePlayerControllable(playerid, 0);
		}
	}
	return 1;
}



Re: Help me please - Cjgogo - 01.07.2013

Yep, I kinda think I know what the problem is, do you see this?

pawn Код:
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
Search for "public EnterExitTimer", and show us that function.


Re: Help me please - Chrisis - 01.07.2013

replace TogglePlayerControllable(playerid, 0); with TogglePlayerControllable(playerid, 1); and it will work ! i will explain

when TogglePlayerControllable is set to 0 the player freeze but when it is set to 1 the player unfreeze


Re: Help me please - TranquiliZed - 01.07.2013

pawn Код:
forward EnterExitTimer(playerid);
public EnterExitTimer(playerid)
{
    TogglePlayerControllable(playerid, 1);
    return 1;
}



Re: Help me please - Cjgogo - 01.07.2013

Quote:
Originally Posted by Chrisis
Посмотреть сообщение
replace TogglePlayerControllable(playerid, 0); with TogglePlayerControllable(playerid, 1); and it will work ! i will explain

When TogglePlayerControllable is set to 0 the player freeze but when it is set to 1 the player unfreeze
What you're saying it's ture, but yet, you got it all worng, the player is frozen UNTIL ALL objects load, so he doesn't fall through the floor, as far as I am concerned, otherwise, just for entering the PD, there's absolutely no reason to freeze player, only if he has a custom interior and/or objects added that need to load. Therefor, that's why tehre is a timer:

pawn Код:
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
And I want to see what's inside that function.