This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Debug.cs
60 lines (50 loc) · 1.97 KB
/
Debug.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
48
49
50
51
52
53
54
55
56
57
58
59
60
#if DEBUG
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GTA;
using GTA.Native;
namespace iFruitAddon2
{
public static class Debug
{
public static int ContactIndex { get => iFruitAddon2.ContactIndex; }
public static void DrawText(string text, int font, bool centre, float x, float y, float scale, int r, int g, int b, int a)
{
Function.Call(Hash.SET_TEXT_FONT, font);
Function.Call(Hash.SET_TEXT_PROPORTIONAL, 0);
Function.Call(Hash.SET_TEXT_SCALE, scale, scale);
Function.Call(Hash.SET_TEXT_COLOUR, r, g, b, a);
Function.Call(Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 255);
Function.Call(Hash.SET_TEXT_EDGE, 1, 0, 0, 0, 255);
Function.Call(Hash.SET_TEXT_DROP_SHADOW);
Function.Call(Hash.SET_TEXT_OUTLINE);
Function.Call(Hash.SET_TEXT_CENTRE, centre);
Function.Call(Hash._SET_TEXT_ENTRY, "STRING");
Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, text);
Function.Call(Hash._DRAW_TEXT, x, y);
}
public static void DestroyPhone(int handle)
{
Function.Call(Hash.DESTROY_MOBILE_PHONE, handle);
}
public static void StartScript(string scriptName)
{
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, 3800);
Function.Call(Hash.SET_SCRIPT_AS_NO_LONGER_NEEDED, scriptName);
}
public static void TerminateScript(string scriptName)
{
Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, scriptName);
}
}
}
#endif