Przyciski ekranu ostrzeżenia
Wybierz, które przyciski z podpowiedziami mają się pojawić na ekranie ostrzeżenia/alertu GTA V, i dostań dokładną wartość flagi do SetWarningMessage / SetWarningMessageWithHeader.
Uwagi pod narzędziem są na razie po angielsku.
30 flag, ustawione: 2
Flagi przycisków
YES | NO
Podgląd
Alert
Are you sure you want to leave the server?
Unsaved progress will be lost.
Tekst
local WARNING_FLAGS = 36 -- YES | NO
-- Warning screens only take text entries, so register our own.
AddTextEntry("FM_WARN_HEADER", "Alert")
AddTextEntry("FM_WARN_LINE1", "Are you sure you want to leave the server?")
AddTextEntry("FM_WARN_LINE2", "Unsaved progress will be lost.")
-- Shows the warning screen every frame until the player picks an option.
local function ShowWarning()
while true do
SetWarningMessageWithHeader("FM_WARN_HEADER", "FM_WARN_LINE1", WARNING_FLAGS, "FM_WARN_LINE2", false, -1, true, true)
-- Input group 2 (frontend) still works while the warning is shown.
-- Enter / A (INPUT_FRONTEND_ACCEPT, INPUT_FRONTEND_SELECT)
if IsControlJustPressed(2, 201) or IsControlJustPressed(2, 217) then
return "accept"
end
-- Esc / Backspace / B (INPUT_FRONTEND_CANCEL)
if IsControlJustPressed(2, 202) then
return "cancel"
end
Wait(0)
end
end
CreateThread(function()
local choice = ShowWarning()
if choice == "accept" then
print("Accepted")
else
if choice == "cancel" then
print("Cancelled")
end
end
end)To narzędzie jest wyłączone na czas konserwacji
Wyłączyliśmy je na chwilę. Reszta strony działa normalnie, a narzędzie wróci samo.
How the button flags work
The instructionalKey / flags argument of SetWarningMessage and SetWarningMessageWithHeader is a bit field. Each bit adds one instructional button to the bottom of the alert screen. Add the values of the buttons you want: Yes (4) + No (32) =36.
SetWarningMessageWithHeader(titleMsg, entryLine1, flags, promptMsg, p4, p5, background, p7, showBg)Things to know
- The warning must be drawn every frame, so call it inside a loop with
Wait(0). - It only accepts text entries, not raw strings. Register your own with
AddTextEntry("MY_KEY", "text"), like the generated snippet does. - The buttons are only visual. You still have to check the keys yourself. Normal controls are blocked while the warning is up, but frontend controls in input group 2 still work:
201accept (Enter),202cancel (Esc),203alternative (Space). - Several bits share the same key, for example Select, OK, Yes and Continue are all Enter. The preview shows what the player sees, the snippet groups them into accept / cancel / alt.
- The constant names in this tool (
YES,CANCEL_TRANSFER…) are descriptive, the game has no official names for most bits.
Button list and bit order from Vespura's warning buttons tool, checked against eInstructionalButtonTypes in the FiveM native docs.
Więcej narzędzi: kalkulatory
Kalkulator hashy joaat
Zamień dowolny string na wartość GetHashKey (joaat) w formie signed, unsigned i hex, od razu.
Kalkulator driving style
Zaznacz zachowania, które chcesz, i dostań wartość flagi driving style do TaskVehicleDriveToCoord i spółki.
Kalkulator flag animacji
Złóż wartość flagi do TaskPlayAnim: pętla, górna część ciała, sterowanie, zatrzymanie na ostatniej klatce i więcej.
