-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmruby_hooks.cpp
executable file
·60 lines (57 loc) · 1.85 KB
/
mruby_hooks.cpp
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
mrb_value mruby__gtav__is_key_down(mrb_state *mrb, mrb_value self) {
mrb_int a0;
mrb_get_args(mrb, "i", &a0);
mrb_bool r0 = IsKeyDown(a0);
return mrb_bool_value(r0);
}
mrb_value mruby__gtav__is_key_just_up(mrb_state *mrb, mrb_value self) {
mrb_int a0;
mrb_get_args(mrb, "i", &a0);
mrb_bool r0 = IsKeyJustUp(a0);
return mrb_bool_value(r0);
}
mrb_value mruby__gtav__is_key_just_up_inclusive(mrb_state *mrb, mrb_value self) {
mrb_int a0;
mrb_get_args(mrb, "i", &a0);
mrb_bool r0 = IsKeyJustUp(a0,0);
return mrb_bool_value(r0);
}
mrb_value mruby__gtav__is_key_just_up_exclusive(mrb_state *mrb, mrb_value self) {
mrb_int a0;
mrb_get_args(mrb, "i", &a0);
mrb_bool r0 = IsKeyJustUp(a0,1);
return mrb_bool_value(r0);
}
mrb_value mruby__gtav__key_just_up(mrb_state *mrb, mrb_value self) {
return mrb_fixnum_value(KeyJustUp());
}
mrb_value mruby__gtav__world_get_all_vehicles(mrb_state *mrb, mrb_value self) {
const int ARR_SIZE = 1024;
Vehicle arr[ARR_SIZE];
int ret = worldGetAllVehicles(arr, ARR_SIZE);
mrb_value rarray = mrb_ary_new_capa(mrb, ret);
for (int i = 0; i < ret; i++) {
mrb_ary_set(mrb, rarray, i, mrb_fixnum_value(arr[i]));
}
return rarray;
}
mrb_value mruby__gtav__world_get_all_peds(mrb_state *mrb, mrb_value self) {
const int ARR_SIZE = 1024;
Ped arr[ARR_SIZE];
int ret = worldGetAllPeds(arr, ARR_SIZE);
mrb_value rarray = mrb_ary_new_capa(mrb, ret);
for (int i = 0; i < ret; i++) {
mrb_ary_set(mrb, rarray, i, mrb_fixnum_value(arr[i]));
}
return rarray;
}
mrb_value mruby__gtav__world_get_all_objects(mrb_state *mrb, mrb_value self) {
const int ARR_SIZE = 1024;
Ped arr[ARR_SIZE];
int ret = worldGetAllObjects(arr, ARR_SIZE);
mrb_value rarray = mrb_ary_new_capa(mrb, ret);
for (int i = 0; i < ret; i++) {
mrb_ary_set(mrb, rarray, i, mrb_fixnum_value(arr[i]));
}
return rarray;
}