Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - LamFloGaming

#1
Support / Showing Speedometer
Aug 09, 2026, 08:35 AM
Hello! It me again.
Today, I found this store on 1 public server Store folder of Rockstar Experience Sprite and this script in script folder:
local g_LocalVehicle = null;
local g_SpeedTableLerpTime = 0.2;
local g_ZeroVector = VectorScreen(0, 0);
local g_FullColour = Colour(255, 255, 255, 255);

local g_StatsLabel = null;
local g_StatsLabelShadow = null; 
local g_StatsBg = null;
local g_DefaultColour = Colour(255, 255, 255, 255);
local g_SpeedHint = null;
sX <- GUI.GetScreenSize().X;
sY <- GUI.GetScreenSize().Y;

local sprite_logo, label_name;

function CenterStatsLabels() {
    if (g_StatsLabel) {
        local pos = VectorScreen(10, sY - 30);
        g_StatsLabel.Pos = pos;
        if (g_StatsLabelShadow) {
            g_StatsLabelShadow.Pos = VectorScreen(10 + 1, sY - 30 + 1);
        }
    }
}

function Script::ScriptLoad() {
    g_StatsLabelShadow = GUILabel(VectorScreen(11, 11), Colour(0, 0, 0, 255), "Loading stats...");
    g_StatsLabelShadow.FontSize = 14;
    g_StatsLabelShadow.FontFlags = GUI_FFLAG_BOLD;
    g_StatsLabel = GUILabel(VectorScreen(10, 10), g_DefaultColour, "Loading stats...");
    g_StatsLabel.FontSize = 14;                       
    g_StatsLabel.FontFlags = GUI_FFLAG_BOLD;         
    g_StatsLabel.TextColour = Colour(224,255,255);

    CenterStatsLabels();
}

function Script::ScriptProcess() { 
    CheckAndUpdateVehicleTableProc();
}

function GUI::GameResize(width, height) {
    sX = width;
    sY = height;
    CheckAndUpdateVehicleTableUI();
    CenterStatsLabels();
}

function Server::ServerData(stream) {
    local cmd = stream.ReadString();

    switch (cmd) {
        case "stats":
            local kills = stream.ReadInt();
            local deaths = stream.ReadInt();
            local gwWins = stream.ReadInt();
            local headshots = stream.ReadInt();
            local duelWins = stream.ReadInt();
            if (g_StatsLabel) {
                local newText = format(
                    "Kills: %d   Deaths: %d   Gangwar Wins: %d   Headshots: %d   Duel Wins: %d",
                    kills, deaths, gwWins, headshots, duelWins
                );
                g_StatsLabel.Text = newText;
                if (g_StatsLabelShadow) g_StatsLabelShadow.Text = newText;
                CenterStatsLabels();
            }
            break;

        case "onPlayerEnterVehicle":
            g_LocalVehicle = World.FindVehicle(stream.ReadInt());
            CreateSpeedTableElements();
            break;

        case "onPlayerExitVehicle":
            g_LocalVehicle = null;
            RemoveSpeedTableElements();
            break;
    }
}

SpeedTableElement <- {
    Ring = null
    Needle = null
}

function CreateSpeedTableElements(posX = 25, posY = 25) {
    SpeedTableElement.Ring = GUISprite("Ring.png", g_ZeroVector, g_FullColour);
    SpeedTableElement.Needle = GUISprite("Needle.png", VectorScreen(posX, posY), g_FullColour);
    SpeedTableElement.Ring.AddChild(SpeedTableElement.Needle);
    SpeedTableElement.Needle.Pos = g_ZeroVector;
    local tempScale = SpeedTableElement.Ring.Size;
    SpeedTableElement.Needle.RotationCentre = VectorScreen(tempScale.X / 2, tempScale.Y / 2);
    g_SpeedHint = GUILabel(VectorScreen(0,0), Colour(255,255,255,255), "Booster: G \n Stop: H");
    g_SpeedHint.FontSize = 13.5;
    g_SpeedHint.TextAlignment = GUI_ALIGN_CENTER;
    CheckAndUpdateVehicleTableUI();
}

function RemoveSpeedTableElements() {
    SpeedTableElement.Ring = null;
    SpeedTableElement.Needle = null;
    if (g_SpeedHint) g_SpeedHint = null;
}

function CheckAndUpdateVehicleTableProc() {
    if (g_LocalVehicle) {
        local speedMagnitude = sqrt(
            g_LocalVehicle.Speed.X * g_LocalVehicle.Speed.X +
            g_LocalVehicle.Speed.Y * g_LocalVehicle.Speed.Y +
            g_LocalVehicle.Speed.Z * g_LocalVehicle.Speed.Z
        );
        if (SpeedTableElement.Ring) {
            SpeedTableElement.Needle.Rotation = Lerp(SpeedTableElement.Needle.Rotation,
                                                     speedMagnitude * 100,
                                                     g_SpeedTableLerpTime);
        }
    }
}

function CheckAndUpdateVehicleTableUI() {
    if (!SpeedTableElement.Ring) return;

    local tempScale = SpeedTableElement.Ring.Size;
    local width = GUI.GetScreenSize().X;
    local height = GUI.GetScreenSize().Y;
    SpeedTableElement.Ring.Pos = VectorScreen((width - tempScale.X) - 25, (height - tempScale.Y) - 25);

    if (g_SpeedHint) {
        local ringPos = SpeedTableElement.Ring.Pos;
        local hintWidth = g_SpeedHint.Size.X;
        local hintHeight = g_SpeedHint.Size.Y;
        local hintX = ringPos.X + (tempScale.X / 2) - (hintWidth / 2);
        local hintY = ringPos.Y - hintHeight - 5;
        g_SpeedHint.Pos = VectorScreen(hintX, hintY);
    }
}

function Lerp(a, b, t) {
    return a + (b - a) * t;
}
And I want to bring the speedometer from this to my server (no need speed hint and stat text). But, I try copy and paste, editing the code but not bring me a answer (doesnt work).
I wish everyone help me!!!
My code:
main.nut in server side:
function onPlayerEnterVehicle( player, vehicle, door )
{
local stream = Stream();
    stream.WriteInt(1);
    stream.WriteString(vehicle.ID.tostring());
    stream.SendStream(player);

local vehID = vehicle.ID;
local vehName = GetVehicleNameFromModel( vehicle.Model );
local vehHealth = vehicle.Health;
ClientMessage("Phuong tien dang lai co ten: " + vehName + " [ID: " + vehID + "] Hien tai xe nay dang co: " + vehHealth + " mau", player, 255, 255, 255);
}

function onPlayerExitVehicle( player, vehicle )
{
local stream = Stream();
    stream.WriteInt(2);
    stream.SendStream(player);

}
and the begin the file:
function SendDataToClient( player, ... )
{
    if( vargv.len() > 0 && vargv[0] )
    {
        local byte = vargv[0],
              len  = vargv.len();

        if( 1 > len ) Message( "ToClient <" + byte + "> No params specified." );
        else
        {
            Stream.StartWrite();
            Stream.WriteByte( byte );

            for( local i = 1; i < len; i++ )
            {
                switch( typeof( vargv[i] ) )
                {
                    case "integer": Stream.WriteInt( vargv[i] ); break;
                    case "string":  Stream.WriteString( vargv[i] ); break;
                    case "float":   Stream.WriteFloat( vargv[i] ); break;
                    case "bool":    Stream.WriteBool( vargv[i] ); break;
                }
            }

            if( player == null ) Stream.SendStream( null );
            else if( typeof( player ) == "instance" ) Stream.SendStream( player );
            else Message( "ToClient <" + byte + "> Player is not online." );
        }
    }
}

// B?ng Byte đ?nh danh
enum StreamType {
    Speedo = 0x01
}

main.nut in client side:
local g_LocalVehicle = null;
local g_SpeedTableLerpTime = 0.2;
local g_ZeroVector = VectorScreen(0, 0);
local g_FullColour = Colour(255, 255, 255, 255);
local g_SpeedHint = null;

sX <- GUI.GetScreenSize().X;
sY <- GUI.GetScreenSize().Y;

function Script::ScriptLoad() {
    Console.Print("[CLIENT] Loaded ClientSide Successfully!!!");
}

function Script::ScriptProcess() { 
    CheckAndUpdateVehicleTableProc();
}

function GUI::GameResize(width, height) {
    sX = width;
    sY = height;
    CheckAndUpdateVehicleTableUI(); // Đã xóa CenterStatsLabels() bị lỗi!
}

function Server::ServerData(stream) {
    local packetID = stream.ReadInt();

    switch (packetID) {
        case 1: // Lên xe
            local vehID_str = stream.ReadString();
            local vehID = vehID_str.tointeger();
           
            g_LocalVehicle <- World.FindVehicle(vehID);
            CreateSpeedTableElements();
            break;

        case 2: // Xuống xe
            g_LocalVehicle = null;
            RemoveSpeedTableElements();
            break;
    }
}

SpeedTableElement <- {
    Ring = null,
    Needle = null
}

function CreateSpeedTableElements(posX = 25, posY = 25) {
    try {
        SpeedTableElement.Ring = GUISprite("sprites/Ring.png", g_ZeroVector, g_FullColour);
        SpeedTableElement.Needle = GUISprite("sprites/Needle.png", VectorScreen(posX, posY), g_FullColour);
       
        SpeedTableElement.Ring.AddChild(SpeedTableElement.Needle);
        SpeedTableElement.Needle.Pos = g_ZeroVector;
       
        local tempScale = SpeedTableElement.Ring.Size;
        SpeedTableElement.Needle.RotationCentre = VectorScreen(tempScale.X / 2, tempScale.Y / 2);
       
        g_SpeedHint = GUILabel(VectorScreen(0,0), Colour(255,255,255,255), "Booster: G \n Stop: H");
        g_SpeedHint.FontSize = 13.5;
        g_SpeedHint.TextAlignment = GUI_ALIGN_CENTER;
       
        CheckAndUpdateVehicleTableUI();
        Console.Print("[SPEEDO] Dong ho Speedometer da load thanh cong!");
    }
    catch(err) {
        Console.Print("[SPEEDO ERROR] -> " + err);
    }
}

function RemoveSpeedTableElements() {
    SpeedTableElement.Ring = null;
    SpeedTableElement.Needle = null;
    if (g_SpeedHint) g_SpeedHint = null;
}

function CheckAndUpdateVehicleTableProc() {
    if (g_LocalVehicle) {
        local speedMagnitude = sqrt(
            g_LocalVehicle.Speed.X * g_LocalVehicle.Speed.X +
            g_LocalVehicle.Speed.Y * g_LocalVehicle.Speed.Y +
            g_LocalVehicle.Speed.Z * g_LocalVehicle.Speed.Z
        );
        if (SpeedTableElement.Ring && SpeedTableElement.Needle) {
            SpeedTableElement.Needle.Rotation = Lerp(SpeedTableElement.Needle.Rotation,
                                                     speedMagnitude * 100,
                                                     g_SpeedTableLerpTime);
        }
    }
}

function CheckAndUpdateVehicleTableUI() {
    if (!SpeedTableElement.Ring) return;

    local tempScale = SpeedTableElement.Ring.Size;
    local width = GUI.GetScreenSize().X;
    local height = GUI.GetScreenSize().Y;
    SpeedTableElement.Ring.Pos = VectorScreen((width - tempScale.X) - 25, (height - tempScale.Y) - 25);

    if (g_SpeedHint) {
        local ringPos = SpeedTableElement.Ring.Pos;
        local hintWidth = g_SpeedHint.Size.X;
        local hintHeight = g_SpeedHint.Size.Y;
        local hintX = ringPos.X + (tempScale.X / 2) - (hintWidth / 2);
        local hintY = ringPos.Y - hintHeight - 5;
        g_SpeedHint.Pos = VectorScreen(hintX, hintY);
    }
}

function Lerp(a, b, t) {
    return a + (b - a) * t;
}

my sprites folder have: Needle.png and Ring.png
#2
Here is the full code:
SpeedTimer <- array(100, null);
function onPlayerEnterVehicle( player, vehicle, door )
{
SpeedTimer[ player.ID ] = NewTimer( "UpdateSpeedometer", 1, 0, player.ID );
}
function onPlayerExitVehicle( player, vehicle )
{
if ( SpeedTimer[ player.ID ] != null )
    {
        SpeedTimer[ player.ID ].Delete();
        SpeedTimer[ player.ID ] = null;
    }
}
function UpdateSpeedometer( playerID )
{
    local player = FindPlayer( playerID );
    if ( player && player.Vehicle )
    {
local vehicle = player.Vehicle;
        local kmh = GetVehicleKMH( player.Vehicle );
        local hp = GetVehicleHealthPercent( vehicle );
       
        Announce( "~w~Speed: ~g~" + kmh + " ~w~KM/H. ~r~HP: "+ hp + " percent", player, 1 );
    }
}
function GetVehicleKMH( vehicle )
{
    if ( vehicle )
    {
        local speed = vehicle.Speed;
        local velocity = sqrt( (speed.x * speed.x) + (speed.y * speed.y) + (speed.z * speed.z) );
        return ( velocity * 180 ).tointeger();
    }
    return 0;
}
function GetVehicleHealthPercent( vehicle )
{
    if ( vehicle )
    {
        local hp = vehicle.Health;
       
        // Máu dư?i 250 là xe n?/cháy, coi như 0%
        if ( hp < 250 ) return 0;
       
        // Quy đ?i t? kho?ng [250 -> 1000] v? [0% -> 100%]
        local percent = ( (hp - 250) / 7.5 ).tointeger();
        return percent;
    }
    return 0;
}
(Some line have Vietnamese text, sorry)
Have fun!!!
#3
Support / Re: Index missing
Jul 31, 2026, 12:15 PM
Quote from: Necroso on Jul 31, 2026, 03:02 AM
Quote from: LamFloGaming on Jul 24, 2026, 08:12 AMHello, I have a big problem: I copy a code in here: https://forum.vc-mp.org/?topic=4353.0, but I launched my server, server console is warning me: The Index 'GUI' does not exist.
I need solution to solve this error

Version of my server: 0.4.7.1
That's because the second part is a client-side script. You need to place it in store/script/somescript.nut

but I moved to client side folder
#4
Quote from: Yankee on May 27, 2017, 09:00 AMIn GTA SA skin sites,there are a lot of skins and i love these skins.How can I convert them to GTA VC.Only .dff and .txd files,should I edit the XML file or what should I do ?

Hello
This convert is doesnt basic is import directly to VC gta3.img (VCMP is the same), The SA skin engine is different of VC, you should find the 3DS Max and a script can inport and export GTA model.
Here is step by step to import SA skin to VC:
1. Download and install 3DS Max.
2. Download the script (Link here: https://www.gtagarage.com/mods/show.php?id=9172), and follow the strcture in readme to install the script.
3. Open 3DS Max, use the script to import SA skin into 3DS Max.
4. Use the script again to import the base skin from VC.
5. Copy the bone of VC Skin to SA skin.
6. Rerigging for correct moving ingame.
7. Export to VC format.
8. Use Magic.TXD open the .txd, and change the version to VC.
Done!!!
(Attention: These instructions may contain errors; please consider them as a reference only.)
#5
Servers / [DM] SpeedUp Community
Jul 28, 2026, 07:45 AM

SpeedUp Community

English: (Sorry, my English is bad)
Discord: discord.gg/YtqQwxK2eR
IP Address: 5.39.63.207:5937 (Can connect directly in browser)
What is SpeedUp Community???
SpeedUp Community is a public server by VIetnamese people make (btw, the maker of this server is me) by creating a Deathmatch server for fun.
You can connect to immerse yourself in a world filled with gunfire and tension!
The server is currently in the Open Beta phase—come join us and contribute to building a powerful server!
If you is a one of player join my server in this phase of server, you will give free Beta Tester Discord role and VIP Free!!!
Join now!!!


Vietnamese:
Tham gia Discord!: discord.gg/YtqQwxK2eR
Địa chỉ IP: 5.39.63.207:5937 (có thể tham gia trực tiếp qua brower)
SpeedUp Community là gì???
SpeedUp Community là một máy chủ do người Việt tạo ra (nhận tiện thì người tạo ra đó là tôi), nhằm tạo ra một sân chơi Deathmatch vui vẻ.
Hãy gia nhập máy chủ để đắm chìm vào một thế giới toàn là tiếng súng và sự căng thẳng!!!
Máy chủ hiện tại đang trong giai đoạn OpenBeta, hãy gia nhập và đóng góp để tạo ra một máy chủ hùng mạnh!!!
Nếu bạn là một trong những người chơi trong giai đoạn này, bạn sẽ được nhận role Beta Tester trên Discord và VIP miến phí!!!
Tham gia ngay!!!
#6
Support / Re: Index missing
Jul 26, 2026, 11:02 AM
Quote from: Vicky on Jul 24, 2026, 03:36 PM
Quote from: LamFloGaming on Jul 24, 2026, 08:12 AMHello, I have a big problem: I copy a code in here: https://forum.vc-mp.org/?topic=4353.0, but I launched my server, server console is warning me: The Index 'GUI' does not exist.
I need solution to solve this error

Version of my server: 0.4.7.1

Are you sure that you copied and pasted it correctly?
Correct 100%!
#7
Support / Re: Announce server to browser
Jul 26, 2026, 11:02 AM
Quote from: Ridwan Rz on Jul 24, 2026, 04:19 PM
Quote from: LamFloGaming on Jul 19, 2026, 01:11 PMHello, after many day developing my server. I bringing my server to a free hosting, but I want to more players find to my server by browser, but I have put announce 1 in server.cfg, but in Master list doesnt have my server. How to bring my server to Master List??? Thank for all helping!

Did you get the latest announce plugin?
How to get it?
#8
Support / Index missing
Jul 24, 2026, 08:12 AM
Hello, I have a big problem: I copy a code in here: https://forum.vc-mp.org/?topic=4353.0, but I launched my server, server console is warning me: The Index 'GUI' does not exist.
I need solution to solve this error

Version of my server: 0.4.7.1
#9
Snippet Showroom / Re: Radio Stations
Jul 24, 2026, 07:46 AM
Are the URL pointing to a file?
#10
Support / Re: A new menu textures
Jul 22, 2026, 01:59 AM
Quote from: Xmair on Jul 18, 2026, 08:31 PMThe radar disc is already customizable. Simply place your custom radar disc here:

store/maps/radar/radardisc.png
The maps are customizable as well:

* Main menu map:
 
store/maps/radar/region00.png - region08.png
* Radar map:
 
store/maps/radar/section00.png - section63.png
As for the custom weapon icons, you can use custom weapons with the default weapon XML files (available in the MVL mod examples):
https://www.gtagarage.com/mods/show.php?id=16467

Get them from this path in the MVL archive:
mvl/help/samplewepxmls
and finally you can just put the weapon icon you want in the custom weapon archive.

The pause screen is not customizable.

More information here:
https://forum.vc-mp.org/index.php?topic=8.0

But I added radardisc.png to store/maps/radar/ but it doesnt load
#11
Support / Re: cant connect to server
Jul 21, 2026, 01:25 AM
Are these server is on??
You should rejoin and check if server is online, if the ping doesnt change on click on server name, server is down, if everything is normal, try the trick if tester above.
#12
Support / Re: Game crash after joining
Jul 21, 2026, 01:22 AM
Please dont install any ASI mod, if modded, game will crash on launch, you should play in original game.
#13
Support / Announce server to browser
Jul 19, 2026, 01:11 PM
Hello, after many day developing my server. I bringing my server to a free hosting, but I want to more players find to my server by browser, but I have put announce 1 in server.cfg, but in Master list doesnt have my server. How to bring my server to Master List??? Thank for all helping!
#14
Support / Re: A new menu textures
Jul 19, 2026, 01:07 PM
Quote from: Xmair on Jul 18, 2026, 08:31 PMThe radar disc is already customizable. Simply place your custom radar disc here:

store/maps/radar/radardisc.png
The maps are customizable as well:

* Main menu map:
 
store/maps/radar/region00.png - region08.png
* Radar map:
 
store/maps/radar/section00.png - section63.png
As for the custom weapon icons, you can use custom weapons with the default weapon XML files (available in the MVL mod examples):
https://www.gtagarage.com/mods/show.php?id=16467

Get them from this path in the MVL archive:
mvl/help/samplewepxmls
and finally you can just put the weapon icon you want in the custom weapon archive.

The pause screen is not customizable.

More information here:
https://forum.vc-mp.org/index.php?topic=8.0

Thanks
#15
Support / Re: A new menu textures
Jul 16, 2026, 01:11 AM
Thanks. But I want to more customize of my server (radar disc, weapon icon,...)