Push

  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
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
{$CLEO}
0000:
0662: "by legend2360"
0662: "BlastHack - cheating is art"
while not SAMP.Available()
wait 400
end
reg_cmd "push" @cmd
lo 0@ @push_set
alloc 1@ 256
memset 1@ 0 256
0C0F: array 0@ element 0 = -1
0C0F: array 0@ element 1 = 1@ // buf
1@ = 0 // no longer used
while true
wait 0
if 30@ == 1
then
chat "pushed {ffff00}%s" -1 1@
call @push_from_set 3 @push_set text 1@ expire_in_ms 60000
30@ = 0
end
if call @check_past_pushes 2 @push_set max_expire 60000 retr_el 3@
then
call @get_string_from_buf 2 @push_set el 3@ retr 4@
chat "deleted el %d - {ffff00}%s" -1 3@ 4@
call @free_el_in_buf 2 @push_set el 3@
continue
end
end
:cmd
gcp 1@
strlen 2@ 1@
if and
2@ > 0
2@ < 32
then 30@ = 1
end
cmdret
:get_string_from_buf
lo 0@ 0@
0C0E: 2@ = array 0@ element 1
0C1F: 3@ = string_array 2@ element 1@ size 32
0C18: 3@ = strstr string1 3@ string2 " "
3@++
ret 1 3@
:free_el_in_buf
lo 0@ 0@
0C0E: 2@ = array 0@ element 0
2@--
0C0F: array 0@ element 0 = 2@
0C0E: 2@ = array 0@ element 1
0C20: string_array 2@ element 1@ size 32 = ""
ret 0
:check_past_pushes
9@ = 0 // out
lo 0@ 0@
0C0E: 2@ = array 0@ element 0 // total items
if 2@ <> -1
then
0C0E: 3@ = array 0@ element 1 // buf
call @GetLocalTimeInMS 0 to 4@
for 5@ = 0 to 7 { 8 } step 1
0C1F: 6@ = string_array 3@ element 5@ size 32
0A8D: 30@ = read_memory 6@ size 1 virtual_protect 0
if 30@ <> 0x0
then
// atoi 7@ 6@
0AD4: 30@ = scan_string 6@ format "%d" 7@
0A8F: 8@ = 7@ - 4@
if or
8@ <= 0
001d: 8@ > 1@
then
8@ = 0xffff
break
end
end
end
end
if 8@ == 0xffff
then ret_true
else ret_false
end
ret 1 5@
:push_from_set
// call @push_to_buf 3 push_set 0@ text 1@ expire_time_in_ms 2@
lo 0@ 0@
0C0E: 3@ = array 0@ element 0 // total items
0C0E: 4@ = array 0@ element 1 // buf
6@ = -1 // var push
if 3@ >= 0
then
if 3@ < 8
then
for 7@ = 0 to 7 { 8 } step 1
0C1F: 8@ = string_array 4@ element 7@ size 32
0A8D: 9@ = read_memory 8@ size 1 virtual_protect 0
if 9@ == 0
then
0085: 6@ = 7@
break
end
end
end
else 6@ = 0
end
if 6@ <> -1
then
call @GetLocalTimeInMS 0 to 5@
005a: 5@ += 2@
alloc 8@ 48
format 8@ = "%d %s" 5@ 1@
0C20: string_array 4@ element 6@ size 32 = 8@
free 8@
3@++
0C0F: array 0@ element 0 = 3@
ret_true
else ret_false
end
ret 0
:GetLocalTimeInMS
alloc 1@ 24
0AA5: call 0x81E514 num_params 1 pop 0 1@
0C0C: 2@ = struct 1@ offset 8 size 2 // Hour
0C0C: 3@ = struct 1@ offset 10 size 2 // Minute
0C0C: 4@ = struct 1@ offset 12 size 2 // Seconds
0C0C: 5@ = struct 1@ offset 14 size 2 // Milliseconds
free 1@
2@ *= 3600000 // hour to ms
3@ *= 60000 // minute to ms
4@ *= 1000 // second to ms
005a: 5@ += 2@
005a: 5@ += 3@
005a: 5@ += 4@
ret 1 5@
:push_set
hex
{0} 00 00 00 00 {4} 00 00 00 00 {8} 00
end