-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.js
57 lines (39 loc) · 1.95 KB
/
client.js
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
// https://imgur.com/AAMq5II
// JS example :
exports('DisplayLeftNotification', (title, subTitle, iconDict, icon, duration) => {
const struct1 = new DataView(new ArrayBuffer(48));
struct1.setInt32(0, duration, true);
struct1.setInt32(8, 0, true);
struct1.setInt32(16, 0, true);
const string1 = CreateVarString(10, "LITERAL_STRING", title);
const string2 = CreateVarString(10, "LITERAL_STRING", subTitle);
const struct2 = new DataView(new ArrayBuffer(72));
struct2.setBigInt64(8, BigInt(string1), true);
struct2.setBigInt64(16, BigInt(string2), true);
struct2.setBigInt64(32, BigInt(GetHashKey(iconDict)), true);
struct2.setBigInt64(40, BigInt(GetHashKey(icon)), true);
struct2.setInt32(48, 0, true);
struct2.setInt32(56, 1, true);
struct2.setInt32(64, 0, true);
setTimeout(function(){
Citizen.invokeNative("0x26E87218390E6729", struct1, struct2, 1, 1);}, 250);
});
exports('DisplayNotification', (text, duration) => {
const str = Citizen.invokeNative("0xFA925AC00EB830B9", 10, "LITERAL_STRING", text, Citizen.resultAsLong());
const struct1 = new DataView(new ArrayBuffer(96));
struct1.setUint32(0, duration, true);
//struct1.setInt32(16, duration, true);
const struct2 = new DataView(new ArrayBuffer(8 + 8));
struct2.setBigUint64(8, BigInt(str), true);
Citizen.invokeNative("0x049D5C615BD38BAD", struct1, struct2, 1);
});
exports('DisplayLocationNotification', (text, location, duration) => {
const struct1 = new DataView(new ArrayBuffer(4 * 4));
struct1.setInt32(0, duration, true);
const string1 = CreateVarString(10, "LITERAL_STRING", location);
const string2 = CreateVarString(10, "LITERAL_STRING", text);
const struct2 = new DataView(new ArrayBuffer(24));
struct2.setBigInt64(8, BigInt(string1), true);
struct2.setBigInt64(16, BigInt(string2), true);
Citizen.invokeNative("0xD05590C1AB38F068", struct1, struct2, 1, 1);
});