How would it be for the message to reach the nearest person? (proximity chat)

do you have for example a /me command, if so you could change it to execute the command as the player using ExecuteCommand('me does something'

1 Like

Everything works except that only the player rolling the dice sees the results.

i add this command and i have error
RegisterCommand(‘roll’, function(source, args, rawCommand)
local number = math.random(1,6)
loadAnimDict(“anim@mp_player_intcelebrationmale@wank”)
TaskPlayAnim(GetPlayerPed(-1), “anim@mp_player_intcelebrationmale@wank”, “wank”, 8.0, 1.0, -1, 49, 0, 0, 0, 0)
Citizen.Wait(1500)
ClearPedTasks(GetPlayerPed(-1))
TriggerEvent(‘chatMessage’, ‘[Dice]’, {128, 0, 128}, 'You Rolled: '…number)
end)

function loadAnimDict(dict)
while not HasAnimDictLoaded(dict) do
RequestAnimDict( dict )
Citizen.Wait(5)
end
end


@KeiranPower Any idea on this, getting the same on this end.

I did this just for grins…

Add this to esx_basicneeds/client/main.lua

RegisterNetEvent(‘esx_basicneeds:onCondom’)
AddEventHandler(‘esx_basicneeds:onCondom’, function(prop_name)
if not IsAnimated then
prop_name = prop_name or ’ ’
IsAnimated = true
Citizen.CreateThread(function()
local playerPed = PlayerPedId()
ESX.Streaming.RequestAnimDict(‘anim@mp_player_intcelebrationmale@wank’, function()
TaskPlayAnim(playerPed, ‘anim@mp_player_intcelebrationmale@wank’, ‘wank’, 8.0, -8, -1, 49, 0, 0, 0, 0)
Citizen.Wait(15000)
IsAnimated = false
ClearPedSecondaryTask(playerPed)
end)
end)
end
end)


Add this to esx_basicneeds/server/main.lua

ESX.RegisterUsableItem(‘condom’, function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem(‘condom’, 1)
TriggerClientEvent(‘esx_status:remove’, source, ‘stress’, 800000)
TriggerClientEvent(‘esx_status:remove’, source, ‘hunger’, 200000)
TriggerClientEvent(‘esx_status:remove’, source, ‘thirst’, 200000)
TriggerClientEvent(‘esx_basicneeds:onCondom’, source)
xPlayer.showNotification(_U(‘used_condom’))
end)


Find a picture of a condom and adjust it to 128x128, throw it in your images directory, then add it as a sell-able item in a grocery store. Basically, my locales response is; “You just did the world a favour”.

Just a short joke I put in my code for the hell of it. :slight_smile:

Cheers