Skip to main content

VS Notification

image

The VS (Versus) Notification displays a competitive head-to-head banner. It shows two player mugshots, their respective scores, and custom background colors.


C# API Reference

Accessor

ScaleformUI.Notifications

Methods

  • ShowVSNotification (Player vs Ped) Displays a versus notification comparing the current player ped and another ped.
    public static async Task<ScaleformUINotification> ShowVSNotification(
    int leftScore,
    HudColor leftColor,
    Ped rightPed,
    int rightScore,
    HudColor rightColor
    )
  • ShowVSNotification (Ped vs Ped) Displays a versus notification comparing two arbitrary peds.
    public static async Task<ScaleformUINotification> ShowVSNotification(
    Ped leftPed,
    int leftScore,
    HudColor leftColor,
    Ped rightPed,
    int rightScore,
    HudColor rightColor
    )

ScaleformUINotification Wrapper Class

This class wraps the active notification handle, allowing you to manage its lifecycle.

Methods

  • Hide Removes the notification from the screen immediately.
    public void Hide()

Lua API Reference

Accessor

Notifications

Methods

  • ShowVSNotification Displays a versus notification between two peds.
    Notifications:ShowVSNotification(leftPed, leftScore, leftColor, rightPed, rightScore, rightColor)
  • Hide Removes the active notification from the screen.
    Notifications:Hide()

Reference Catalogs

NotificationChar Catalog

The following texture dictionary names are available for advanced notifications:

KeyTexture Dictionary
AbigailCHAR_ABIGAIL
AmandaCHAR_AMANDA
AmmunationCHAR_AMMUNATION
AndreasCHAR_ANDREAS
AntoniaCHAR_ANTONIA
AshleyCHAR_ASHLEY
BankOfLibertyCHAR_BANK_BOL
BankFleecaCHAR_BANK_FLEECA
BankMazeCHAR_BANK_MAZE
BarryCHAR_BARRY
BeverlyCHAR_BEVERLY
BikeSiteCHAR_BIKESITE
BlankEntryCHAR_BLANK_ENTRY
BlimpCHAR_BLIMP
BlockedCHAR_BLOCKED
BoatSiteCHAR_BOATSITE
BrokenDownGirlCHAR_BROKEN_DOWN_GIRL
BugStarsCHAR_BUGSTARS
Call911CHAR_CALL911
LegendaryMotorsportCHAR_CARSITE
SSASuperAutosCHAR_CARSITE2
CastroCHAR_CASTRO
ChatCallCHAR_CHAT_CALL
ChefCHAR_CHEF
ChengCHAR_CHENG
ChengSeniorCHAR_CHENGSR
ChopCHAR_CHOP
CrisCHAR_CRIS
DaveCHAR_DAVE
DefaultCHAR_DEFAULT
DeniseCHAR_DENISE
DetonateBombCHAR_DETONATEBOMB
DetonatePhoneCHAR_DETONATEPHONE
DevinCHAR_DEVIN
SubMarineCHAR_DIAL_A_SUB
DomCHAR_DOM
DomesticGirlCHAR_DOMESTIC_GIRL
DreyfussCHAR_DREYFUSS
DrFriedlanderCHAR_DR_FRIEDLANDER
EpsilonCHAR_EPSILON
EstateAgentCHAR_ESTATE_AGENT
FacebookCHAR_FACEBOOK
FilmNoireCHAR_FILMNOIR
FloydCHAR_FLOYD
FranklinCHAR_FRANKLIN
FranklinTrevorCHAR_FRANK_TREV_CONF
GayMilitaryCHAR_GAYMILITARY
HaoCHAR_HAO
HitcherGirlCHAR_HITCHER_GIRL
HunterCHAR_HUNTER
JimmyCHAR_JIMMY
JimmyBostonCHAR_JIMMY_BOSTON
JoeCHAR_JOE
JosefCHAR_JOSEF
JoshCHAR_JOSH
LamarDogCHAR_LAMAR
LesterCHAR_LESTER
SkullCHAR_LESTER_DEATHWISH
LesterFranklinCHAR_LEST_FRANK_CONF
LesterMichaelCHAR_LEST_MIKE_CONF
LifeInvaderCHAR_LIFEINVADER
LsCustomsCHAR_LS_CUSTOMS
LSTICHAR_LS_TOURIST_BOARD
ManuelCHAR_MANUEL
MarnieCHAR_MARNIE
MartinCHAR_MARTIN
MaryAnnCHAR_MARY_ANN
MaudeCHAR_MAUDE
MechanicCHAR_MECHANIC
MichaelCHAR_MICHAEL
MichaelFranklinCHAR_MIKE_FRANK_CONF
MichaelTrevorCHAR_MIKE_TREV_CONF
WarStockCHAR_MILSITE
MinotaurCHAR_MINOTAUR
MollyCHAR_MOLLY
MorsMutualCHAR_MP_MORS_MUTUAL
ArmyContactCHAR_MP_ARMY_CONTACT
BrucieCHAR_MP_BRUCIE
FibContactCHAR_MP_FIB_CONTACT
RockStarLogoCHAR_MP_FM_CONTACT
GeraldCHAR_MP_GERALD
JulioCHAR_MP_JULIO
MechanicChineseCHAR_MP_MECHANIC
MerryWeatherCHAR_MP_MERRYWEATHER
UnicornCHAR_MP_STRIPCLUB_PR
MomCHAR_MRS_THORNHILL
MrsThornhillCHAR_MRS_THORNHILL
PatriciaTrevorCHAR_PATRICIA
PegasusDeliveryCHAR_PEGASUS_DELIVERY
ElitasTravelCHAR_PLANESITE
SasquatchCHAR_SASQUATCH
SimeonCHAR_SIMEON
SocialClubCHAR_SOCIAL_CLUB
SolomonCHAR_SOLOMON
TaxiCHAR_TAXI
TrevorCHAR_TREVOR
YouTubeCHAR_YOUTUBE
WadeCHAR_WADE

HudColor Values

Commonly used HUD color indices:

Enum NameValue
HUD_COLOUR_PURE_WHITE0
HUD_COLOUR_WHITE1
HUD_COLOUR_BLACK2
HUD_COLOUR_GREY3
HUD_COLOUR_RED6
HUD_COLOUR_BLUE9
HUD_COLOUR_YELLOW12
HUD_COLOUR_ORANGE15
HUD_COLOUR_GREEN18
HUD_COLOUR_PURPLE21
HUD_COLOUR_PINK24

Runnable Examples

C# Example

This example shows how to trigger a VS notification when a player kills an opponent.

using System;
using System.Threading.Tasks;
using CitizenFX.Core;
using ScaleformUI;
using ScaleformUI.Scaleforms;

public class PvPTracker : BaseScript
{
private int playerScore = 0;
private int opponentScore = 0;

public PvPTracker()
{
Tick += OnTick;
}

private async Task OnTick()
{
// Press F6 to simulate a player kill
if (Game.IsControlJustPressed(0, Control.SelectCharacterFranklin))
{
playerScore++;
Ped opponent = Game.PlayerPed; // Using player ped as a placeholder opponent

ScaleformUINotification vsNotification = await Notifications.ShowVSNotification(
Game.PlayerPed,
playerScore,
HudColor.HUD_COLOUR_BLUE,
opponent,
opponentScore,
HudColor.HUD_COLOUR_RED
);

// Keep the notification on screen for 5 seconds, then hide it
await Delay(5000);
vsNotification.Hide();
}
}
}

Lua Example

This example shows how to trigger a VS notification in Lua.

local playerScore = 0
local opponentScore = 0

RegisterCommand("testvs", function()
playerScore = playerScore + 1
local playerPed = PlayerPedId()
local opponentPed = playerPed -- Using player ped as a placeholder opponent

Notifications:ShowVSNotification(
playerPed,
playerScore,
9, -- HUD_COLOUR_BLUE
opponentPed,
opponentScore,
6 -- HUD_COLOUR_RED
)

-- Hide the notification after 5 seconds
Citizen.CreateThread(function()
Citizen.Wait(5000)
Notifications:Hide()
end)
end, false)