This doesn't work and i can't fix it , can someone help please?
4 replies, posted
i can't fix this for some reason, just gives me more errors. its suposed to be a chat filter and i have made the right files and things. i am putting it in autorun/server
[CODE]hook.Add("OnPlayerChat", "chat_filter", function( player, strText )
local tab = {}
if ( IsValid( player ) ) then
table.insert( tab, player )
else
table.insert( tab, "Console" )
end
local incomplete = string.Explode( strText, " ")
local pre_table = util.KeyValuesToTable( file.Read( "meisno/reham.txt" )
local function apartk()
for k,v in ipairs(pre_table)
return k
end
end
local function apartv( K )
for k,v in ipairs(pre_table)
if k == K then
return v
end
end
end
for k,v in ipairs(incomplete) do
local value = tostring(v)
if value = apartK() then
value = apartv( k )
end
end
local complete = string.Implode( incomplete , " " )
table.insert( tab, Color( 255, 255, 255 ) )
table.insert( tab, ": "..complete )
chat.AddText( unpack(tab) )
return true
end)
[/CODE]
[editline]07:53PM[/editline]
1 hour bump, please!
Would be nice to take a look at the errors
[b][url=wiki.garrysmod.com/?title=Gamemode.OnPlayerChat]Gamemode.OnPlayerChat [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] is a clientside hook.
What you need is this one. [url]http://wiki.garrysmod.com/?title=Gamemode.PlayerSay[/url]
[QUOTE=Ningaglio;21229591]i can't fix this for some reason, just gives me more errors. its suposed to be a chat filter and i have made the right files and things. i am putting it in autorun/server
[editline]07:53PM[/editline]
1 hour bump, please![/QUOTE]
To bad this is client side Gamemode hook.
:ninja:'d
Sorry, you need to Log In to post a reply to this thread.