forked from Bob74/iFruitAddon2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTools.cs
47 lines (39 loc) · 1.18 KB
/
Tools.cs
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
36
37
38
39
40
41
42
43
44
45
46
47
using GTA;
using GTA.Native;
namespace iFruitAddon2
{
public static class Helper
{
public static string SetBold(this string text, bool bold)
{
if (bold) return text.ToLower();
else return text.ToUpper();
}
}
}
public static class Tools
{
internal static class Scripts
{
internal static void DestroyPhone(int handle)
{
Function.Call(Hash.DESTROY_MOBILE_PHONE, handle);
}
internal static void StartScript(string scriptName, int buffer)
{
Function.Call(Hash.REQUEST_SCRIPT, scriptName);
while (!Function.Call<bool>(Hash.HAS_SCRIPT_LOADED, scriptName))
{
Function.Call(Hash.REQUEST_SCRIPT, scriptName);
Script.Yield();
}
Function.Call(Hash.START_NEW_SCRIPT, scriptName, buffer);
Function.Call(Hash.SET_SCRIPT_AS_NO_LONGER_NEEDED, scriptName);
}
internal static void TerminateScript(string scriptName)
{
Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, scriptName);
}
}
}