- Регистрация
- 22 Янв 2018
- Сообщения
- 190
- Лучшие ответы
- 0
- Репутация
- 1
Всем привет! У меня есть такой FS на /fly. Так вот, как сделать, чтобы при выходи из /fly тебя телепортировало на то место, где ты прописал его?
PHP:
stock CancelFlyMode(playerid)
{
DeletePVar(playerid, "FlyMode");
CancelEdit(playerid);
TogglePlayerSpectating(playerid, false);
DestroyPlayerObject(playerid, noclipdata[playerid][flyobject]);
noclipdata[playerid][cameramode] = CAMERA_MODE_NONE;
SetPlayerPos(playerid, GetPVarFloat(playerid, "FlyX"), GetPVarFloat(playerid, "FlyY"), GetPVarFloat(playerid, "FlyZ"));
return 1;
}
PHP:
stock FlyMode(playerid)
{
// Create an invisible object for the players camera to be attached to
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
noclipdata[playerid][flyobject] = CreatePlayerObject(playerid, 19300, X, Y, Z, 0.0, 0.0, 0.0);
// Place the player in spectating mode so objects will be streamed based on camera location
TogglePlayerSpectating(playerid, true);
// Attach the players camera to the created object
AttachCameraToPlayerObject(playerid, noclipdata[playerid][flyobject]);
SetPVarInt(playerid, "FlyMode", 1);
noclipdata[playerid][cameramode] = CAMERA_MODE_FLY;
SetPVarFloat(playerid, "FlyX", X);
SetPVarFloat(playerid, "FlyY", Y);
SetPVarFloat(playerid, "FlyZ", Z);
return 1;
}