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.

Topics - umar4911
1
General Discussion / VKs Winter Wars 2021 - Register Now
« on February 17th, 09:53 AM »
VKs Winter Wars is originally the VKs Christmas Jolly Event but this time, the event has been shifted to another server.

New features:
- Event server is scripted in SqMod so you can get a smoother version of the event
- Reduced custom content thus less lag
- Better GUI for the event
- No 50-cap limit

For more info, refer to the forum thread or join our Discord server!


Trailer:


https://www.youtube.com/watch?v=mwR8Mjz2JCc
2
General Discussion / Evolution A/D League invitation
« on January 16th, 04:20 PM »


EAD staff are back again presenting to you Season Three of EAD League 2021!
The event that everyone was waiting for to go out there and rock the battlefields with their clan mates!


If you haven't heard about it before, Let's see how it works:
  • Gather your squad and make a team application here.
  • There's a certain amount of rounds to be decided as soon as the teams are decided, in which each team plays one match/round and they don't have to play their matches in order.
  • Each team picks 2 bases from the base list. These bases will stay with them till the league ends.
  • No teams can pick similar bases.
  • The matches are usually 5 v 5, except if both teams agree to play with less than 5, that's okay too.
  • Four bases for each match, with a total of 8 rounds.
  • Team applications has specific requirements this year, Please check it out here before applying.
  • We're very strict about rules, so make sure you check them in the Rules & Regulations.

If you'd like to be part of the staff, Apply as a referee here.!
It's as simple as that. Further information can be found here.
Click here to join EAD League discord
If you have any questions, feel free to ask here and the staff will answer you shortly.

Have a nice one folks, We will be waiting for you.
3
Snippet Showroom / SetSkin and onPlayerSkinChange
« on January 14th, 09:14 AM »
if you change your skin using player.Skin = skin; your weapon resets. In order to avoid that, add this in your script:

Code: [Select]
function CPlayer::SetSkin(skin) {
    local slot = this.Slot;
    this.Skin = skin;
    this.Slot = slot;
}

Now use:
Code: [Select]
player.SetSkin(skinid)



onPlayerSkinChange
If you want this event, use:

Code: [Select]
function CPlayer::SetSkin(skin) {
    local slot = this.Slot, oldskin = this.Skin;
    this.Skin = skin;
    this.Slot = slot;
  onPlayerSkinChange(this, oldskin, skin)
}

Event:
Code: [Select]
function onPlayerSkinChange(player, OldSkin, NewSkin) {
}
5
Snippet Showroom / [Gamedig] VCMP Activity Monitor
« on August 20th, 2020, 06:37 PM »
VCMP Server Monitor

Even though it is easy to write the packets but I found this very cool npm library which shortens your work. It returns the all the server information so complete credits to the contributors of the library.


GameDig - Game Server Query Library

All the information about this library is present in it's GitHub Repository.

Link: https://github.com/gamedig/node-gamedig

Note: This library is not specifically for vcmp.


Example

I created a sample script using which you can get the information of a server in JSON. I deployed it on Heroku.

Replace ip and port with the server's Ip and port
https://vcmp-info.herokuapp.com/ip/port


Click here to get server information of LW


Click here to get server information of VKs


The source code is present in my Github Repository.

Example of the JSON code:
Code: [Select]
{
  "msg": "success",
  "state": {
    "name": "VKs official server [VRocker hosting]",
    "map": "",
    "password": false,
    "raw": {
      "version": "04rel006",
      "numplayers": 12,
      "gamemode": "United CA Mode v5.4.1",
      "map": "Vice City"
    },
    "maxplayers": 50,
    "players": [
      {
        "name": "=KF=SHy^LT"
      },
      {
        "name": "[RT]Martyrdom"
      },
      {
        "name": "[RT]ShadowJacK."
      },
      {
        "name": "[F2]MK14"
      },
      {
        "name": "=SdS=SupeR^DaviD*"
      },
      {
        "name": "[WSt]Jhanders"
      },
      {
        "name": "KeNgAhMeD2008"
      },
      {
        "name": "[KFt]Sos^"
      },
      {
        "name": "Jocoka"
      },
      {
        "name": "HUSSIENPRO"
      },
      {
        "name": "Jezza^++"
      },
      {
        "name": "Todor03"
      }
    ],
    "bots": [],
    "connect": "51.38.93.130:8194",
    "ping": 12
  }
}


6
Client Scripting / [Release] X3DEditor - Buildmode Purpose
« on July 19th, 2020, 07:08 PM »
X3DEditor

I've seen VCMP scripters who are working with the GUI are not so familiar with the 3D elements. Since it is a part of my upcoming release, I thought to share it. This script is originally made for scripters who creates GUI in buildmode. Using this snippet, you can easily find the position, rotation and size of a 3D Element.

Note: This only supports DecUI

Understanding controls

It has total 3 types;
  • Position
  • Rotation
  • Size

Position
In order to enter the position changing mode, press 1 from keyboard.

Arrow up - Moves the element forward
Arrow down - Moves the element backward
Arrow left - Moves the element left
Arrow right - Moves the element right
Page up - Moves the element vertically upwards
Page down - Moves the element vertically downwards


Rotation
In order to enter the rotation changing mode, press 2 from keyboard.

Arrow Keys - Change the rotation respectively
Delete - Horizontally rotates to the left (backward)
Page down - Horizontally rotates to the right (forward)



Size
In order to enter the Size changing mode, press 3 from keyboard.

Arrow up - Decreases the size vertically
Arrow down - Increases the size vertically
Arrow left - Decreases the size horizontally
Arrow right - Increases the size horizontally


Saving & Exporting
In order to stop editing the element and export the data, press Backspace key.
This will return print the values and also copy them to the clipboard

Youtube Video


https://www.youtube.com/watch?v=e5k-ZElC55U


Code and example



The code and example is present on the Github Repository.



7
Client Scripting / [Release] Icons Font for VCMP
« on May 27th, 2020, 09:02 AM »
Credits:

VC:MP Icons Font
This font allows to use icons in your GUI Labels. Here is the chart:



Originally it has more than 90 glyphs, try going through character map to view them all (some of them might be repeating).

It has all properties of a normal GUILabel. You can use TextColour, align, padding, flags, or whatever you want.

Download:
https://www.mediafire.com/file/x6068hfb5l7bhs4/FAEditUmar_unp.7z/file

Installation:
Paste the 7z file in store/fonts


Usage:
- Use FontName of a Label as "FAEditUmar"

Note: The size of some of the icons might be varying.
8
Tutorials / [Client Side] Sending data + DecUI
« on May 25th, 2020, 08:57 AM »
I wrote this guide for a friend who wanted to know how to send data from server to client and how to use DecUI. I thought why not post here too.

The function is taken from here https://forum.vc-mp.org/?topic=4484 Credits: Seby
DecUI is taken from here https://forum.vc-mp.org/?topic=6775 Credits: NewK


P.S: Sorry in advance if it's a little messed up.

Comments are added in each code for more explanation.





okay first example. We are sending kills from the server which should show to the player using a label


In order to record the identifier bytes, we can use enumerations (enum as short) like

Code: [Select]
enum ByteInfo {
Kills = 0x02
}


Let's set that as soon as player spawns, it is shown.

Code: [Select]


enum ByteInfo {
Kills = 0x02
};


function onPlayerSpawn(player)
{
// The ByteInfo.Kills will record it's identifier
SendDataToClient(player, ByteInfo.Kills, status[player.ID].kills, status[player.ID].Deaths)

// We send 3 values to the client, in the order, byte, int, int
}

// here is the special func
function SendDataToClient( player, ... )
{
if( vargv[0] )
{
local   byte = vargv[0], len = vargv.len();
Stream.StartWrite();
Stream.WriteByte( byte );
if( 1 < len )
{
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;
}
}
}
if( player == null ) Stream.SendStream( null );
else if( typeof( player ) == "instance" ) Stream.SendStream( player );
else return;
}
}




Now we have sent data from the server. Lets get those values in client side
Code: [Select]

enum ByteInfo {
Kills = 0x02
};


function Server::ServerData(Data)
{
// the first parameter we sent for all the data packets will be a byte so lets get it
local byte = Data.ReadByte();
// the local will store it's value

//since we used ByteInfo.Kills for the kills label
switch (byte)
{
case ByteInfo.Kills:
// the next values we sent where kills and deaths in the order and both were int vals
local kills = Data.ReadInt(),
deaths = Data.ReadInt();
// values stored

// I'll use a func to make the labels
CreateKillsGUI(kills, deaths);
break;
default: break;
}
}

function CreateKillsGUI(kills, deaths) {
// you know the drill how to create GUILabels

// In order to help you, I'll use DecUI to Create a Label
local LabelKills = UI.Label({
    id = "KillsLabel" 
    Text = "Kills: " + kills
FontSize = 16
TextColour = Colour(255, 255, 255)
// It helps you do some cool alignments
align = "hud_bottom"
FontFlags = (GUI_FFLAG_BOLD)

// I want the label to move a little more down
move = {down = "10%"}
});


local LabelDeaths = UI.Label({
    id = "LabelDeaths" 
    Text = "Deaths: " + deaths
FontSize = 16
TextColour = Colour(255, 255, 255)
align = "hud_bottom"
FontFlags = (GUI_FFLAG_BOLD)

// deaths should be a bit more down
move = {down = "13%"}
});
}


Since we created the labels in DecUI, we will be needing the update the labels too.

Let's make like, the player uses the same byte to send the data and the same function to update the labels. We will edit our function

Code: [Select]
function CreateKillsGUI(kills, deaths) {
    // We used ID `KillsLabel` to create Label for kills

    if(UI.Label("KillsLabel") != null)
    {
        // if the value is not null, means a label with that ID exists
        UI.Label("KillsLabel").Text = "Kills: " + kills
    }
    else
    {
        // if the condition is null, means the label doesn't exist. Lets create it
        local LabelKills = UI.Label({
            id = "KillsLabel" 
            Text = "Kills: " + kills
            FontSize = 16
            TextColour = Colour(255, 255, 255)
            // It helps you do some cool alignments
            align = "hud_bottom"
            FontFlags = (GUI_FFLAG_BOLD)

            // I want the label to move a little more down
            move = {down = "10%"}
        });
    }
    // similar for the deaths

    if(UI.Label("LabelDeaths") != null)
    {
        UI.Label("LabelDeaths").Text = "Deaths: " + deaths
    }
    else
    {
        local LabelDeaths = UI.Label({
            id = "LabelDeaths" 
            Text = "Deaths: " + deaths
            FontSize = 16
            TextColour = Colour(255, 255, 255)
            align = "hud_bottom"
            FontFlags = (GUI_FFLAG_BOLD)

            // deaths should be a bit more down
            move = {down = "13%"}
        });
    }
}

Okay let's do some more cool things with DecUI. Let's create a progress bar for health instead of the text


We will be using event onPlayerHeathChange. Also we need to add another identifier in the enum.
Server Side
Code: [Select]
enum ByteInfo {
Kills = 0x02
HpBar = 0x03
};

function onPlayerHeathChange(player, oldHp, newHp)
{
//since we need to send the new health only and Health is a float value, we'll convert to integer
SendDataToClient(player, ByteInfo.HpBar, newHp);
}



Client-Side has a function `Script::ScriptLoad()` which runs when all files are downloaded and loaded in the server. Acts like onPlayerJoin

Client Side
Code: [Select]
// lets get the func scriptload
enum ByteInfo {
Kills = 0x02
HpBar = 0x03
};

function Script::ScriptLoad() {

    // first of all, we need to remove the player's health from hud
    Hud.RemoveFlags( HUD_FLAG_HEALTH );

    SetHealthBar(); // the function used to create the health bar
}

// to change the values of the progressbar when player's health change
function Server::ServerData(Data)
{
// the first parameter we sent for all the data packets will be a byte so lets get it
local byte = Data.ReadByte();
// the local will store it's value

switch (byte)
{
case ByteInfo.Kills: // kills label
// the next values we sent where kills and deaths in the order and both were int vals
local kills = Data.ReadInt(),
deaths = Data.ReadInt();
// values stored

// I'll use a func to make the labels
CreateKillsGUI(kills, deaths);
break;

        case ByteInfo.HpBar: //GUI Health bar
            // we sent player's health which is in an int value. Lets store that in a variable
            local health = Data.ReadInt();

            // lets create using a func again
            SetHealthBar(health);
        break;
default: break;
}
}

//now the function itself
function SetHealthBar(health = 100) {

    // we will use canvas and add progress bar as its child so we can easily position the label

    // condition to check if the health was already present
    if(UI.Canvas("HealthCanvas") == null)
    {
        local hpcan = UI.Canvas({
            id = "HealthCanvas" 
            // another cool func in DecUI
            RelativeSize = ["7%", "3.5%"] // parameters are width and height, using percent means the part of the screen size of the player
           
            // we want it at the position of old health bar and hud_left doesn't exist :c
            align = "hud_right"
            move = {left = "19.5%", down = "8.5%"}               
           
            // lets add a progressbar but as a child of the canvas
            children = [
                // progressbar
                UI.ProgressBar({
                    id = "HealthBar"
                    RelativeSize = ["100%", "100%"] // it will inherit the size of the canvas since canvas is it's parent


                    // some basic things
                    MaxValue = 100
                    Thickness = 2
                    StartColour = Colour(255, 77, 77)
                    EndColour = Colour(150, 40, 40)
                    selectedColour = Colour(255, 100, 100)
                    Value = health
                })
                // now lets add a label
                UI.Label({
                    id = "HealthLabel" 
                    Text = health + "%"
                    FontSize = 12
                    TextColour = Colour(255, 255, 255)
                    align = "center" // it will align itself according to the canvas since canvas is the parent. center means to the center of the canvas
                })
            ]
        });
    }
    else
    {
        // when we receive the data from the server when player health is changed


        //if the canvas is already present, then obv children will also be. lets change their values
        UI.ProgressBar("HealthBar").Value = health;
        UI.Label("HealthLabel").Text = health + "%";   
    }
}

9
Bugs and Crashes / [BUG] GUILabel.Size
« on April 6th, 2020, 07:44 PM »
Description
GUILabel.Size doesn't change when GUILabel.FontSize is changed

Reproducible
Always

What you were doing when the bug happened
I changed FontSize and printed the values

What you think caused the bug
The Developers
10
Scripting and Server Management / Object XML Format
« on August 18th, 2019, 12:20 PM »
Code: [Select]
<?xml version="1.0" encoding="ASCII" ?>
<itemlist>
 <item model="1083" name="Home">
  <position x="-34.6886" y="1763.63" z="32.1387" />
  <rotation format="axisangle" x="0" y="0" z="-0.703279" angle="-0.710914" />
 </item>
</itemlist>

What can be other formats for rotation except axisangle? Is there any for Euler?
11
Support / Ping starting spiking
« on June 30th, 2019, 06:01 AM »
I have transworld internet, 20mbps package. Using speedtest.net, I get around 16 Mbps downloading and 18 Mbps uploading. Like a month before, I had 150 pings in almost all servers including vks, lw, ec, ptp, etc. Now I have the same internet, same speed but my ping now spikes a lot. It reaches to 1K or even 2K. Average ping is like 300 now. I need help here. I get kicked a lot too. Note: I got no new apps in my PC and I also tried by closing all the applications in the background using the internet including discord.  I can't figure the issue out. Any help will be appreciated.
12
Scripting and Server Management / Custom Radar Map
« on April 20th, 2019, 06:52 AM »
I got a map which is loaded perfectly and now I want to load its custom radar. What are sections and regions of map? How can I trace the section and region of a location?
13
Bugs and Crashes / [Bug] FPS Limit Uncapped
« on April 12th, 2019, 06:33 AM »
Description
If you press escape, the limit of 60 fps is uncapped. I get about 450-750 fps

Reproducible
Always

What you were doing when the bug happened
When I go in the menu (press escape) then I change mouse sensitivity.

What you think caused the bug
The new update

@Stormeus
14
Bugs and Crashes / [Bug] Chat Desync
« on April 9th, 2019, 05:06 PM »
Description
When playing, after about 15-45 mins, the chat desync and it loads the chat from chat like  "=EK=UmaR^ joined the server"
Note: I didn't modify screen size and it happened after the new update

Reproducible
Always

What you were doing when the bug happened
Usually Dming


What you think caused the bug
Rel006 update

@Stormeus
15
Scripting and Server Management / how to use Livemap plugin
« on April 8th, 2019, 06:48 PM »
the livemap plugin, its syntax, how to integrate with a website and how to make it work?