i mean:
"on" is a variable.
if on[id]==1 then
then if a player type any msg it should contain "By Player" in every end of the msg.
example :- i typed "hi"
then it should be displayed as "hi by player"
i need to do it with txt:sub.
addhook("say", "test_say") function testsay(id, txt) msg("\"" .. txt .. "\" by player " .. player(id, "name")) return 1 end
pm={} function listm(id) men="list player" for g=1,32 do if player(g,"exists") then men=men..','..player(g,"name") else men=men..',' end end menu(id,men) end addhook("serveraction","s") function s(id,a) if a==1 then listm(id) end end addhook("menu","mk") function mk(id,title,button) if title=="list player" then if button>0 then pm[id]=button msg2(id,"write massage now") end end end addhook("say","ss") functions ss(id,txt) if pm[id]==nil then pm[id]=0 elseif pm[id]>0 then msg2(pm[id],txt.." by "..player(id,"name")) pm[id]=0 return 1 end end
addhook("say","sa") function sa(id,txt) if txt:sub(1,2)=="hi" then ----- checked char1 until char2 msg(txt:sub(1,2).." by "..player(id,"name")) return 1 end end