Hello guys, I’m developping a script using the instruction DisplayOnscreenKeyboard but I don’t know how to get what the user has written, I’ve been using GetOnscreenKeyboardResult() but the script is not waiting for someone to write something it just keep going and I don’t know how to make it wait and get what it’s written.
here is what my script look like:
Citizen.CreateThread(function()
local inputText
while true do
DisplayOnscreenKeyboard(false, "FMMC_KEY_TIP8", "", "", "", "", "", 64)
Citizen.Wait(0)
if (IsControlJustPressed(1,Keys["ENTER"])) then
inputText = GetOnscreenKeyboardResult()
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_ALL_PLAYERS_CONF", "CHAR_ALL_PLAYERS_CONF", true, 1, "Message reçu", "");
DrawNotification(false, true);
else
SetNotificationTextEntry("STRING");
AddTextComponentString(inputText);
SetNotificationMessage("CHAR_ALL_PLAYERS_CONF", "CHAR_ALL_PLAYERS_CONF", true, 1, "Pas de message envoye", "");
DrawNotification(false, true);
break
end
end
end)