Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using GTA.Math;
- using GTA.Native;
- using System;
- using System.Windows.Forms;
- namespace Sync_Scene_Prac
- {
- public class Main : Script
- {
- Ped player = Game.Player.Character;
- bool SceneActive = false;
- int SceneIndex = -1;
- int SceneID;
- Prop Duffelbag;
- public Main()
- {
- Tick += onTick;
- KeyDown += onKeyDown;
- }
- private void onTick(object sender, EventArgs e)
- {
- if (SceneActive)
- {
- switch (SceneIndex)
- {
- case 0:
- {
- Function.Call(Hash.REQUEST_ANIM_DICT, "anim@heists@money_grab@duffel");
- Model bagmodel = new Model("p_ld_heist_bag_01");
- bagmodel.Request(10000);
- if (bagmodel.IsValid && bagmodel.IsInCdImage)
- {
- while (!bagmodel.IsLoaded) Script.Wait(50);
- Duffelbag = World.CreateProp(bagmodel, player.Position, false, false);
- }
- SceneIndex = 10;
- break;
- }
- case 10:
- {
- SceneID = Function.Call<int>(Hash.CREATE_SYNCHRONIZED_SCENE, player.Position.X, player.Position.Y, player.Position.Z, player.Rotation.X, player.Rotation.Y, player.Rotation.Z, 2);
- Function.Call(Hash.TASK_SYNCHRONIZED_SCENE, player, SceneID, "anim@heists@money_grab@duffel", "exit", 1.0f, -1.0f, 3341, 16, 0x447a0000, 0);
- Function.Call(Hash.PLAY_SYNCHRONIZED_ENTITY_ANIM, Duffelbag, SceneID, "exit_bag", "anim@heists@money_grab@duffel", 1000, -1000, 0, 0x447a0000);
- SceneIndex = 20;
- break;
- }
- case 20:
- {
- if (Function.Call<float>(Hash.GET_SYNCHRONIZED_SCENE_PHASE, SceneID) > 0.999f)
- {
- player.Task.ClearAll();
- if (Duffelbag != null)
- {
- Duffelbag.Delete();
- }
- SceneIndex = -1;
- SceneActive = false;
- }
- break;
- }
- }
- }
- }
- private void onKeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.D9)
- {
- SceneActive = true;
- SceneIndex = 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement