01.06.2013, 18:45
Have you learned about timers?
you can try setting a timer. TogglePlayerControllable(playerid,0);
then set timer for one second, TogglePlayerControllable(playerid,1);
to give the objects time to load
EG:
That may do the job
2 second timer to freeze the player when they spawn. Its in Milliseconds so you may want to change it to your taste. Once the timer dies, it sets them to controllable again

then set timer for one second, TogglePlayerControllable(playerid,1);
to give the objects time to load
EG:
pawn Код:
public OnPlayerSpawn(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
new Float, Float:y, Float:z;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
x = dini_Float(file, "posX");
y = dini_Float(file, "posY");
z = dini_Float(file, "posZ");
SetPlayerPos(playerid, x,y,z);
SetTimerEx("spawn",2000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
forward spawn(playerid);
public spawn(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}

