911 & OOC scripts for fxserver?

The 911 & OOC for fxserver, can anyone give me the links or link me to the forum/GitHub page please?

911: [Release][EssentialMode] /me /911 /dispatch Scripts
OOC Chat: [Release] OOC Chat - for Roleplay Servers

You know it’s amazing what comes up as the first search result in Google.

Yeah it is, I tried that, it didn’t work.

Well, there you go :slight_smile:
If that’s not the 911 you were looking for, I also found this one: FiveMScripts: 911 Command.

Ok I got the 911 command to work, just not the OOC :frowning:

Maybe try it from the github?

Great release! Can’t wait to see your future scripts.

What’s up?
I haven’t tested OOC with any of the latest updates pretty much since release so, if for some reason it doesn’t work anymore let me know what it does for you and I’ll see if I can fix it. :slight_smile:

Whenever I run OOC it says Error running system event handling function for resource ooc: citizen:/scripting/lua/scheduler.lua:39: Failed to execute thread: server.lua:10: attempt to call a nil value (method ‘Split’)
stack traceback:
server.lua:10: in function ‘stringsplit’
server.lua:2: in upvalue ‘handler’
citizen:/scripting/lua/scheduler.lua:124: in function citizen:/scripting/lua/scheduler.lua:123
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:39: in field ‘CreateThreadNow’
citizen:/scripting/lua/scheduler.lua:123: in function citizen:/scripting/lua/scheduler.lua:92

Yet I have seen people running FxServer with OOC?

This script was made for CFX. You’ll have to change the string splitting function in order for it to work, because str:split doesn’t exist in FXServer.

Server.lua - FX version:

AddEventHandler('chatMessage', function(source, name, msg)
	sm = stringsplit(msg, " ");
	if sm[1] == "/ooc" then
		CancelEvent()
		TriggerClientEvent('chatMessage', -1, "OOC | " .. name, { 128, 128, 128 }, string.sub(msg,5))
	end
end)

function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

Link to porting notes: https://wiki.fivem.net/wiki/Running_FXServer#Porting_Notes

So just change my code to that one.

Yes, that should work.

Ok cheers, I’ll try that now.

Thank you so much, my friend.

OOC thread and GitHub downloads are updated and now work. It was indeed the stringsplit function that i hadn’t updated. :slight_smile: