[Release][EssentialMode] /me /911 /dispatch Scripts

Add the below code to your sv_admin commands in [essential] resource folder.

This is live on our SLHGames Public Server

/911 “allows the user to call 911”
/dispatch “lets a dispatcher respond”
/me “a player is doing an action”

Also, Thanks to @Trouble for help

Did a small update, the other script kept crashing out and messing up for some reason so i redid it. This code works better

New code 2/6/2017
-This works 100%, But requires a new user permission at the top
-Also removed “is” from /me

local permission = {
	kick = 1,
	normal = 0,
	ban = 3
}
-- 911 DISPATCHER
TriggerEvent('es:addAdminCommand', 'dispatch', permission.normal, function(source, args, user)
	table.remove(args, 1)
	TriggerClientEvent('chatMessage', -1, "^5[911]", {30, 144, 255}, " (^1 Dispatcher: ^3" .. GetPlayerName(source) .." | "..source.."^0 ) " .. table.concat(args, " "))
end, function(source, args, user)
	TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)

-- 911 CALL
TriggerEvent('es:addAdminCommand', '911', permission.normal, function(source, args, user)
	table.remove(args, 1)
	TriggerClientEvent('chatMessage', -1, "^5[911]", {30, 144, 255}, " (^1 Caller ID: ^3" .. GetPlayerName(source) .." | "..source.."^0 ) " .. table.concat(args, " "))
end, function(source, args, user)
	TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)

-- ME
TriggerEvent('es:addAdminCommand', 'me', permission.normal, function(source, args, user)
	table.remove(args, 1)
	TriggerClientEvent('chatMessage', -1, "^3[Me]", {255, 0, 0}, " (^2 " .. GetPlayerName(source) .." | "..source.."^0 ) " .. table.concat(args, " "))
end, function(source, args, user)
	TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
16 Likes

Awesome! Thanks for sharing this. I was just trying to figure out a 911 call script. You’re a life saver!

1 Like

Hey,
Is it possible to make the /me script listen to /do instead and also. i would like to make the structure like this:

“(Username)|(UserID) [Does] (What ever he types)” and if possible in a different colour

Note: I tried to edit it but it did not work.

Excellent work mate its scripts like these that are really needed in a RP server ty

Looking good, im sure many people will use this. :slight_smile:

Just take the “is” out if you don’t want that there. Idk about /do but you can change it from me to do

i tried to change the order of everything but that does not seem to work

no you cant change the order just edit the words and the colors. All 3 are literally the same script just different words

I have added to the location but when i run a command nothing happens? any ideas

scrap that all working

Thanks for sharing and very cool idea. I will be installing this as well. Thanks Jester

Yeah I have issue where my commands just stop working after a while. Really annoying it’s something with essential

did a small update guys, fixed a problem i was having

Getting this error when trying to join my server: Game/GameServer.cs(690): Warn: GameServer::HandleReliableCommand: A client tried to send an event of type es:firstJoinProper, but it was not greenlit for client invocation. You may need to call RegisterServerEvent from your script.

i get the same, but its not because of this i get random errors sometimes even before this.

Also make sure your lua or dlls aren’t blocked. Zip the entire folder then unzip it and it will unblock all files that may be blocked. Shouldn’t be trying to host from windows version other than server tho… lol

Where is the download link?

its code you insert into the essential mode admin commands file…

I dont like how the people of the server see the 911 calls how can I just restrict it to just the police?

It’s called code yourself your own groups. I didn’t get that far into coding. Instead of saying you don’t like something help make it better? People don’t seem to understand the concept of a open sourced community

5 Likes

how change the permission level plz ?