15.08.2012, 19:56
Hi.
Today I was scripting a house (entering/exiting interior, entering/exiting balcony...).
I had ad little problem with exit/enter. When you enter/exit house, sometimes objects don't load in time so you fall through ground...
I put a little timer which freezes you when you type /enter, and unfreezes you after 1 second.
Here is a part of the code:
The problem is that this worked only for the first player to type /enter. All other players stay frozen.
Please help me to fix this problem, I am a beginner at this.
Today I was scripting a house (entering/exiting interior, entering/exiting balcony...).
I had ad little problem with exit/enter. When you enter/exit house, sometimes objects don't load in time so you fall through ground...
I put a little timer which freezes you when you type /enter, and unfreezes you after 1 second.
Here is a part of the code:
Код:
forward unfreeze(playerid); public unfreeze(playerid) { TogglePlayerControllable(playerid, 1); } CMD:enter(playerid, params[]) { TogglePlayerControllable(playerid, 0); SetPlayerPos(playerid,491.1090,1398.9766,1080.2578); etPlayerInterior(playerid, 2); SetTimer("unfreeze", 1000, false); SetPlayerFacingAngle( playerid, 0 ); return 1; }
Please help me to fix this problem, I am a beginner at this.