-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass1.cs
More file actions
35 lines (33 loc) · 1.08 KB
/
Class1.cs
File metadata and controls
35 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using GTA;
using GTA.Native;
using GTA.Math;
namespace PlayerReliveNoReModel
{
public class ReliveNoReModel : Script //继承“Script”类
{
Ped player;//设player是主角
Timer dead_timer = new Timer();
public ReliveNoReModel()
{
Tick += OnTick;
}
void OnTick(object sender, EventArgs e)
{
player = Game.Player.Character;
bool isExist = Function.Call<bool>(Hash.DOES_ENTITY_EXIST, player);//人物是否存在,如果不存在有可能是在加载游戏
if (isExist)
{
if ( player.IsDead == false&&this.dead_timer.IsOverTime && Game.IsScreenFadedOut && Function.Call<int>(Hash.GET_TIME_SINCE_LAST_DEATH) < 10000 && Function.Call<int>(Hash.GET_TIME_SINCE_LAST_ARREST) < 10000)
{
this.dead_timer.Set(1000);
Game.FadeScreenIn(5000);
}
}
else
{
return;
}
}
}
}