CLEO Help Cutout specifed string out of a string

CLEO related

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
hello guys i need to cut out the text Occurred Polozhenie after killed and its ID too from this chat string
* 7Killer(59) killed Polozhenie(109) (Weapon: Sawn-off Shotgun) (Distance: 12m)
the ones marked in red are not permanent texts it can be random any string or any value
the ones writen in green are the texts i wana cutout from it

Sorry for my bad english
 

Tuzas

Active member
Joined
Nov 1, 2019
Messages
145
Reaction score
80
Location
null
local sampev = require 'lib.samp.events'

function main()
while not isSampAvailable() do wait(100) end
while true do
wait(0)
end
end

function sampev.onServerMessage(color, text)
if text:find('* .+ killed (.+) .+Weapon: .+.+ .+Distance: .+m.+') then
local text1 = text:match('* .+ killed (.+) .+Weapon: .+.+ .+Distance: .+m.+')
lua_thread.create(function()
wait(200)
sampAddChatMessage(text1, -1)
end)
end
end


stop using shitty cleo language
 

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
local sampev = require 'lib.samp.events'

function main()
while not isSampAvailable() do wait(100) end
while true do
wait(0)
end
end

function sampev.onServerMessage(color, text)
if text:find('* .+ killed (.+) .+Weapon: .+.+ .+Distance: .+m.+') then
local text1 = text:match('* .+ killed (.+) .+Weapon: .+.+ .+Distance: .+m.+')
lua_thread.create(function()
wait(200)
sampAddChatMessage(text1, -1)
end)
end
end


stop using shitty cleo language
is it cleo or lua i havent learned lua it looks harder than cleo
 
Top