LK_lk
September 22, 2017, 4:07pm
1
Hi could someone help me with this please i have done something wrong but not sure what
AddEventHandler(‘chatMessage’, function(source, n, message)
command = stringsplit(message, " ")
if(command[1] == “/command”) then
CancelEvent()
TriggerClientEvent(“chatMessage”, -1, “”, { 255, 251, 15 }, “/showid [first name] [last name] [age] [wanted yes or no]”)
end
end)
Havoc
September 22, 2017, 4:12pm
3
LK_lk:
TriggerEvent(“notifaction”, “”, { 0, 0, 0 }, “Hello world!”)
I assume you have this event in a client file and you have an event handler. If not, you need to do that.
Then, you can add the code to show a notification.
Edit: If you just want to send a chat message, use the “chatMesssage” event.
Something like
TriggerEvent("EVENT_HERE", "Name Here", {0,0,0}, "Message Here")
There’s a lot of information available on the Wiki . There’s no notification
event by default.
LK_lk
September 22, 2017, 4:14pm
5
I have it in a client file but that is it i am sure its possible but not sure how to do it.
LK_lk
September 22, 2017, 4:35pm
6
So could I put the event name as a native db or does it have to be a event and if it has to be event where can i get list of them?
LK_lk
September 22, 2017, 4:39pm
7
So you mean like this or ?
AddEventHandler(“playerSpawned”, function(spawn)
TriggerEvent(“Notifaction”, “welcomnotify”, { 0, 0, 0 }, “Hello world!”)
end)
Havoc
September 22, 2017, 4:42pm
8
There’s a couple of events on the wiki but, you would have to look in other resources (like the chat resource) for more specific events (e.g. the “chatMessage” event).
Client Events: https://wiki.fivem.net/wiki/Client_events
Server Events: https://wiki.fivem.net/wiki/Server_events
LK_lk:
Notifaction
There is no “Notifaction” event. There’s a “chatMessage” event… I think that’s what you’re after.
LK_lk
September 22, 2017, 4:44pm
9
Im after something where when someone joins the server it has a notifaction bottom left corner like if player died that type of notifaction but gotta find right thing.
LK_lk
September 22, 2017, 4:46pm
10
I have found something in othe peoples scripts so i just made this
AddEventHandler(“playerSpawned”, function(spawn)
notification(‘WELCOME’)
end)
function notification(msg)
SetNotificationTextEntry(“STRING”)
AddTextComponentString(msg)
DrawNotification(false, false)
end
DONT THINK IT IS GOING TO WORK BUT IS THIS AT ALL RIGHT IN ANY WAY?
LK_lk
September 22, 2017, 4:52pm
11
This worked thanks for your help man