Help me please
#1

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
Reply
#2

try TogglePlayerControllable(playerid,1);
Reply
#3

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

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);
Reply
#5

Show us the code.
Reply
#6

Код:
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;
}
Reply
#7

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.
Reply
#8

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
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)