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 - Xmair
1
Client Scripting / [Release] XAnimations - A basic approach with animations
« on June 12th, 04:58 PM »
XAnimations



I have been working with client side a lot lately and had some spare time so I decided to make a basic library for animations. This library serves more as a template to create your own animations than as an actual library due to it being really compact.


Code and Examples


All the examples as well as the code is available at the GitHub repository (note that GitHub messed up the indentation a bit, it should look fine after downloading/cloning it).


Credits


2
Tutorials / [Windows] Writing a C++ plugin
« on December 26th, 2019, 03:17 PM »
No this isn't the best guide you can get. I wrote this tutorial reaaaaaaaallllllllly long ago for someone in Discord.

Firstly, you need to choose a good IDE for writing C++, what I personally use is Visual Studio.
So here the second step becomes loading up and creating a project in Visual Studio

Click the Create a new project button to start
Then you choose Dynamic-Link Library as that's what we're gonna be needing

Next you'd want to select a name for your project, choose whatever name you want and name the solution to your desire aswell

Click on Create, this may take some time

We won't be needing dllmain.cpp and framework.h so you can delete them
Now firstly we need to include the VCMP header file, you can find the updated one here:
https://bitbucket.org/stormeus/0.4-squirrel/src/
Search for the VCMP.h file and click on it

Now copy all the file and come back to your Visual Studio project
Right click on Header Files
Go to Add -> New Item or simply press CTRL + SHIFT + A
Set the file type to Header File (.h)
Set the name to VCMP.h

Click on Add
Paste your clipboard (VCMP.h copied from BitBucket) into the new opened file
Now your file should look like this

Create a new file in the Source Files folder named Main.cpp
Now before we move on to code, we need to select the compiling platform
In my case I needed x64 builds as Release and not Debug (it doesn't really matter at this point but anyway) so I changed my configuration to Release x64

Now we create another file in Header Files named Main.h which will serve as a header file for our main file
In the Main.h file, we do:
Code: [Select]
#pragma once // Only load this file once (#include)
#ifndef __MAIN_H // Include guard; makes sure that this file is only included once and subsequent #includes are ignored
#define __MAIN_H // Include guard

#include "VCMP.h"
#include <cstdio>

#ifdef _WIN32 // If we're on windows
#include "Windows.h"

#define DLL_EXPORT __declspec( dllexport ) // This is required in windows so that other programs can access the function
#else // We're not on windows
#define DLL_EXPORT // Nothing like that is required in linux so we leave it blank
#define MAX_PATH 250
#endif

#ifdef __cplusplus // We don't need to (and can not) extern "C" if we're already in C. so we make sure that we are in C++
extern "C" { // We need to extern "C" the function because windows expects a C-style function
#endif
    DLL_EXPORT    unsigned int            VcmpPluginInit(PluginFuncs* pluginFuncs, PluginCallbacks* pluginCalls, PluginInfo* pluginInfo); // This is a blank function and it's exported (check the #define tags above). VCMP requires it
#ifdef __cplusplus // We opened a brace in C++, so we need to close it in C++ only as well
}
#endif

#endif // Include guard
Now we come back to the Main.cpp file and,
Code: [Select]
#include "pch.h" // Pre-compiled header
#include "VCMP.h" // We need to include the VCMP header file first so we can access it's functons
#include "Main.h" // Including the main header file we created

uint8_t serverInitialise() {
    printf("Plugin initialised.\n"); // Sending a message to make sure our plugin has loaded
    return 1;
}

// This event is called when the plugin is loaded
// We can also make a global variable to store the plugin functions, callbacks and info
unsigned int VcmpPluginInit(PluginFuncs* pluginFuncs, PluginCallbacks* pluginCalls, PluginInfo* pluginInfo)
{
    pluginInfo -> apiMinorVersion = PLUGIN_API_MINOR; // This step is very important, in this step
    pluginInfo -> apiMajorVersion = PLUGIN_API_MAJOR; // we set the version of the API, if you skip this step, your server will not load this plugin

    pluginCalls -> OnServerInitialise = serverInitialise; // uint8_t(*OnServerInitialise) (void) - Line 915 @ VCMP.h
    return 1;
}

Now right click on your project name, in my case, VCMP
Click on Build

Your output should show something similar to this

Now go to the compiled directory, in my case, C:\Users\Xmair\source\repos\VCMP\x64\Release

Copy the VCMP.dll to a VC:MP server
Paste it in the plugins folder

Now edit your server.cfg file to include your plugin

Now load up your server.

Credits: Xmair & Fleka (for the comments in VCMP.h file)
3
Skin Showroom / Adolf Hitler
« on November 20th, 2019, 10:47 AM »
Content Type: Skin
Original Author: Click.
Source Link: Click.
Modifications:: Converted to VC and created XML file.
Modified By: Xmair.
Authorized By Original Author?: No.
Screenshot: Click.
Download Link: Click.
Faults: It has a minor bug with the sleeves, not really a big issue. But yeah it is expected since this is my first conversion.
4
Bugs and Crashes / [Bug] Immunity flags sometimes do not work
« on August 12th, 2019, 02:13 PM »
I am not sure if this was reported earlier or not.

Description
The bullet_proof immunity flag (1) will stop working if you knock down a player and use a SMG/Pistol.

Reproducible
Always

What you were doing when the bug happened
Nothing.

What you think caused the bug
No idea.

Steps to reproduce
1. Set a player's to immunity to 1.
2. Get yourself a MP5.
3. Shoot the player. (No health decreases)
4. Knock the player down.
5. Shoot the player while they are knocked down. (Health decreases)
6. The health will stop decreasing once the player gets up.
5
Support / [Suggestion] Ability to increase server boundaries
« on August 12th, 2019, 02:11 PM »
Currently we can only set the world boundaries to a specific limit, can we somehow patch this limit so we can possibly add the SA map or possibly more maps that require the boundary limit to be touched and exceeded.
6
Bugs and Crashes / [Bug] Spectating breaks when you are drunk
« on July 26th, 2019, 12:00 PM »
Description
Spectating breaks when you are drunk.

Reproducible
Always

What you were doing when the bug happened
Playing VCCNR.

What you think caused the bug
Camera movement?

Steps to reproduce
1. Set your player to have drunk effects.
2. Spectate someone.
7
Bugs and Crashes / [Bug] XML cannot load some objects
« on July 25th, 2019, 06:38 PM »
Description
XML cannot create some specific objects, for example: weapons
This does work on CreateObject.

Reproducible
Always

What you were doing when the bug happened
Adding a map to my server's store folder.

What you think caused the bug
No idea.

Steps to reproduce
1. Create an XML file with this data:
Code: [Select]
<?xml version="1.0" encoding="ASCII" ?>
<itemlist>
<item model="269" name="chainsaw">
<position x="0" y="0" z="2" />
<rotation format="axisangle" x="0" y="0" z="0" angle="1" />
</item>
</itemlist>
2. Join the game.
3. You now have yourself a "[MAPS] Model index 269 is invalid." error.
8
Bugs and Crashes / [Bug] Can enter a vehicle as passenger while frozen
« on July 24th, 2019, 11:22 AM »
Description
You can enter in a vehicle as passenger while you're frozen.

Reproducible
Always

What you were doing when the bug happened
Eating M&M'S.

What you think caused the bug
Missed a check while coding?

Steps to reproduce
1. Go near a vehicle.
2. Freeze yourself.
3. Press V to enter the vehicle as a passenger.
9
Tutorials / [Linux-Ubuntu] Setting up a radio stream
« on June 27th, 2019, 09:17 AM »
I was asked by someone on how to set up a radio stream and instead of telling them, I figured I should make a guide so everyone can know how to do so. Please note that this guide is for Linux so please do not ask basic Linux questions here. This guide was tested on Ubuntu 18.10 (GNU/Linux 4.18.0-24-generic x86_64) (Ubuntu 18.10 x64) and works perfectly.

We will be needing 2 packages, icecast2 and ezstream.
So firstly start off by installing icecast2:
Code: [Select]
sudo apt-get install icecast2
Note: sudo isn't needed if you're on root.
You'll be prompted for configuring icecast2, choose yes and choose passwords which suit you well and write them down somewhere to remember them as they'll be used later.
After installing the icecast server, it should start itself (which it did for me). However if it does not, use the following command:
Code: [Select]
sudo /etc/init.d/icecast2 start
Note: sudo isn't needed if you're on root.
You should now be able to access the icecast2 server's administration page by opening your browser and visiting your domain with 8000 port, or your IP with the 8000 port. The 8000 port is currently the default one and it can be changed by opening and editing the config. [1]
Now to install ezstream:


Code: [Select]
sudo apt-get update
sudo apt-get install ezstream
Note: sudo isn't needed if you're on root.


Now I would suggest creating a different user for this, so:


Code: [Select]
sudo adduser radiostream
Note: sudo isn't needed if you're on root.


Now log into your newly created user either in a new session or by using the su command.
Make a directory named music, in this directory you'll be adding all your music files.
Make another directory named .ezstream, this is where we will keep the ezstream's configuration file(s). [2]


Code: [Select]
mkdir music
mkdir .ezstream


Now copy a template of ezstream's configuration file.


Code: [Select]
cp /usr/share/doc/ezstream/examples/ezstream_mp3.xml .ezstream
Note: You can take a look at /usr/share/doc/ezstream/examples/ for more of the examples.


This step is not mandatory, but this is for our own ease and should be done if you're going to host multiple streams.
In this step we change the name of the copied file:


Code: [Select]
cd .ezstream
mv ezstream_mp3.xml hollywood.xml
Note: This guide now assumes that you've changed the name to hollywood.xml and all the steps will now treat the file name as such.


Now edit the configuration file:


Code: [Select]
nano hollywood.xml


Change the <sourcepassword></sourcepassword> from hackme to whatever password you set before and the <filename></filename> to hollywood.txt. You can change other configurations as per required such as the <url></url> if you're going to host multiple streams. If you want your radio stream to be looped forever and not end once it has played all the songs in the playlist, set <stream_once></stream_once> to 0.
Press CTRL+X, press y and then press enter/return to save the file.

Now come back to the user directory:


Code: [Select]
cd -


We're now going to make a file that automatically puts all the mp3 files present in the music directory into the hollywood.txt file. [3]


Code: [Select]
nano hollywood.sh


Copy paste this into hollywood.sh:


Code: [Select]
#!/bin/bash
find music -name *mp3 -type f > .hollywood.txt
echo "Created the hollywood.txt playlist. Now starting the stream."
ezstream -c .ezstream/hollywood.xml


Press CTRL+X, press y and then press enter/return to save the file.
Now make the file executable:


Code: [Select]
chmod +0700 hollywood.sh


This is where you upload your music to the music folder. Please note that the format should be MP3.
After you're done uploading, create either a tmux session or use the screen command and execute the hollywood.sh file. However, tmux is recommended.


Code: [Select]
tmux
./hollywood.sh


OR


Code: [Select]
screen ./hollywood.sh


You're now basically done. Now head over to your icecast2 server's administration page. It should be yourdomain.com:8000 or yo.ur.i.p:8000 or localhost:8000 if you're browsing from the OS itself. Go to Administration > Mountpoint List and copy the link address of the M3U your stream. It should be something like ip:8000/stream.m3u or domain:8000/stream.m3u.





Now finally you can head over to your script and add this line:


Code: [Select]
CreateRadioStream( "Hollywood Songs Stream", "[paste copied url here]", true );


Adios y buena suerte!
 1. You can access the config file at /etc/icecast2/icecast.xml, in here you can change your passwords or the port and other configs.
 2. You can add more radio streams by repeating the same method.
 3. Source: https://www.maketecheasier.com/run-a-diy-internet-radio-station-with-icecast-linux/
10
I've noticed a lot of people using the standard flip command which always changes the vehicle's direction to North. I was playing with rotations today and was able to make a somewhat better command that actually flips your vehicle in the direction it was, without changing it's direction to North all the time.

The code has been moved to pastebin for indentation's sake.
Code: [Select]
https://pastebin.com/dKgSfEiC
11
Servers / [0.4] Vice City Cops & Robbers
« on June 24th, 2018, 06:59 AM »

VCCNR INVITATION!



About us: Everyone's favorite game mode is back! Vice City Cops and Robbers makes an epic return on Sunday, 24th June 2018. The project, spearheaded by Joker and Xmair, brings many new features and improved familiar ones, and also many more to come in the future. The economy has been carefully balanced, which will ensure fair and exciting gameplay. Everyone is welcome to check out the brand new VCCNR at launch.

VCCNR is a unique server compared to the other servers on the VCMP platform due to the fact that this server is a roleplay server where you can either be a civilian, a robber or become a cop and arrest all the law breakers. By robbing shops and malls you can earn money and after a person gain a certain amount of robskills, they can even rob the only bank in the game! Although this seems quite easy, a cop can come out of nowhere and arrest you! For every wanted star the cop gets a certain amount of money which can be deposit in the bank later on. And for every wanted star the law breaker goes in jail for a certain amount of time You can buy houses, vehicles and a lot of various things with the money that you save. There are more exciting features in the server, and many more will hopefully arrive VERY soon in the near feature. Don't miss out on the fun and join us!

Regards,
VCCNR Management


12
Closed Bug Reports / [Bug] Colour changing
« on June 13th, 2018, 02:02 PM »
Description
Whenever you use hex codes in ClientMessages, the last line is always white.

Reproducible
Always

What you were doing when the bug happened
ClientMessage( "This server was scripted by [#FFFFFF]Xmair[$FF]. A huge thanks to [#FFFFFF]Joker[$FF], [#FFFFFF]UncleMeme[$FF], [#FFFFFF]Zihad[$FF], [#FFFFFF]ShadowWarrior[$FF], [#FFFFFF]Gorcee[$FF] and [#FFFFFF]Xobert[$FF] for contributing throughout the beta version.", player, 176, 176, 176 );

What you think caused the bug
No idea.
13
Scripting and Server Management / GUI Edit Box's background
« on August 26th, 2017, 08:13 AM »
Is there any way to make the GUIEditBox's background transparent?
14
Closed Bug Reports / [Crash] 006652D5
« on August 22nd, 2017, 03:06 PM »
Reproducible
Always

What you were doing at the time of the crash
Loading a custom object

What you think caused the crash
Object being big?

Are you using the Steam version?
No.

Crash Report
Code: [Select]
Address: 006652D5 error C0000005
EAX 10111004 EBX 030C40D4 ECX FF989C98 EDX 00000098
EBP 000003F1 ESP 0018E6CC ESI 0CCF7A8C EDI 0FC81004
Stack:
00000500
0CCF7A8C
00000001
030C40D4
00000000
00000100
00DD0000
0D3F32F0
7744E20C
06440031
00000047
00DD01C4
00DD0000
7749041D
7744E20C
063B0032
00000047
00ECD950
00DD0000
00DD7768
00000001
00000040
00000079
00000000
0D38C740
00DD7458
00DD7588
0D3A23A0
00DD7AC0
00000000
0018E6D8
00DD7458
0018E80C
0D3A23A0
77452B21
0D3A23A0
00000000
00000040
00000000
0018E858
00000008
0D4AD1E8
00000000
00000038
00000000
0018E870
00000008
0D4CF950
00010000
00000001
00000000
00000040
0018E828
7391825F
04184800
0018E7B8
00000001
0D2EBB40
0018EC14
33545844
00000001
00000002
00000000
00000048
00000001
0018E81C
76944958
00DD0000
00140008
76944A93
B3E67819
0D2EBB64
0018E858
00000001
00140008
00000000
00000000
00000000
0018E7E4
00000000
0018F264
76965EB0
C568E9BD
FFFFFFFE
76944A93
7390A411
00000040
00000040
0018E83C
7391AD8B
00000040
0018E860
0018E850
7391AE19
0018E858
00000040
00000000
0018E864
7391AED3
0D3A23A0
00000020
0D3A23C0
0018E878
73959165
00000020
0018E8C8
0D2EBB40
0018EC50
7396378C
0D2EBB48
0D2EBB64
33545844
00000001
0416F6A0
00000400
00000400
00000000
0FB80040
00001000
00000000
0D4CF950
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
Net version 67000, build version 59379D3F.
00400000 S 00628000 N D:\GTA Vice City\gta-vc.exe
10000000 S 00007000 N C:\Program Files (x86)\Internet Download Manager\idmmkb.dll
21100000 S 0005E000 N D:\GTA Vice City\mss32.dll
22100000 S 00014000 N D:\GTA Vice City\mss\Mssa3d.m3d
22200000 S 00015000 N D:\GTA Vice City\mss\Mssa3d2.m3d
22300000 S 00011000 N D:\GTA Vice City\mss\Mssds3ds.m3d
22400000 S 00014000 N D:\GTA Vice City\mss\Mssds3dh.m3d
22500000 S 00014000 N D:\GTA Vice City\mss\Msseax.m3d
22600000 S 00016000 N D:\GTA Vice City\mss\Mssfast.m3d
22D00000 S 00062000 N D:\GTA Vice City\mss\Mssrsx.m3d
22E00000 S 00019000 N D:\GTA Vice City\mss\msseax3.m3d
24600000 S 00011000 N D:\GTA Vice City\mss\Reverb3.flt
26F00000 S 0002A000 N D:\GTA Vice City\mss\Mp3dec.asi
6D930000 S 00CC4000 N C:\Windows\system32\nvd3dum.dll
703A0000 S 00423000 N C:\Users\Xmair\AppData\Local\Vice City Multiplayer\04rel004\vcmp-game.dll
71BA0000 S 00218000 N C:\Windows\AppPatch\AcGenral.DLL
725C0000 S 00012000 N C:\Windows\system32\pnrpnsp.dll
72790000 S 00006000 N C:\Windows\system32\DCIMAN32.dll
727A0000 S 000E7000 N C:\Windows\system32\ddraw.dll
728E0000 S 00013000 N C:\Windows\system32\dwmapi.dll
72900000 S 00080000 N C:\Windows\system32\UxTheme.dll
729E0000 S 0004B000 N C:\Windows\system32\apphelp.dll
730C0000 S 00010000 N C:\Windows\system32\napinsp.dll
73120000 S 00008000 N C:\Windows\System32\winrnr.dll
73140000 S 00014000 N C:\Windows\system32\MSACM32.dll
73650000 S 0000D000 N C:\Windows\system32\sfc_os.DLL
73670000 S 00003000 N C:\Windows\system32\sfc.dll
73680000 S 0000F000 N C:\Windows\system32\samcli.dll
736C0000 S 00010000 N C:\Windows\system32\NLAapi.dll
736D0000 S 00036000 N C:\Windows\system32\AUDIOSES.DLL
73710000 S 00072000 N C:\Windows\system32\DSOUND.DLL
73790000 S 0004E000 N C:\Users\Xmair\AppData\Local\Vice City Multiplayer\04rel004\libpng15.dll
738F0000 S 00105000 N C:\Windows\system32\d3d8.dll
73A10000 S 000F5000 N C:\Windows\System32\PROPSYS.dll
73B10000 S 0000B000 N C:\Windows\system32\profapi.dll
73B20000 S 00017000 N C:\Windows\system32\USERENV.dll
73B80000 S 00007000 N C:\Windows\system32\avrt.dll
73B90000 S 00039000 N C:\Windows\System32\MMDevApi.dll
73BD0000 S 00038000 N C:\Windows\System32\fwpuclnt.dll
73EB0000 S 00005000 N C:\Windows\System32\wshtcpip.dll
73EC0000 S 00044000 N C:\Windows\system32\DNSAPI.dll
73F20000 S 00025000 N C:\Windows\system32\powrprof.dll
73F50000 S 00009000 N C:\Windows\system32\HID.DLL
73F60000 S 00006000 N C:\Windows\system32\d3d8thk.dll
73F70000 S 00030000 N C:\Windows\system32\dinput8.dll
73FC0000 S 00006000 N C:\Windows\system32\rasadhlp.dll
740A0000 S 0003C000 N C:\Windows\System32\mswsock.dll
740E0000 S 00009000 N C:\Windows\system32\VERSION.dll
741A0000 S 00032000 N C:\Windows\system32\winmm.dll
741E0000 S 00012000 N C:\Windows\system32\MPR.dll
74200000 S 00007000 N C:\Windows\system32\WINNSI.DLL
74210000 S 0001C000 N C:\Windows\system32\IPHLPAPI.DLL
74F80000 S 0000C000 N C:\Windows\syswow64\CRYPTBASE.dll
74F90000 S 00060000 N C:\Windows\syswow64\SspiCli.dll
74FF0000 S 00006000 N C:\Windows\syswow64\NSI.dll
75000000 S 00019000 N C:\Windows\SysWOW64\sechost.dll
75020000 S 0000A000 N C:\Windows\syswow64\LPK.dll
75030000 S 0019D000 N C:\Windows\syswow64\SETUPAPI.dll
751D0000 S 00C49000 N C:\Windows\syswow64\SHELL32.dll
75E20000 S 00060000 N C:\Windows\system32\IMM32.DLL
75E80000 S 000F0000 N C:\Windows\syswow64\RPCRT4.dll
76070000 S 0009D000 N C:\Windows\syswow64\USP10.dll
76160000 S 00100000 N C:\Windows\syswow64\kernel32.dll
76260000 S 000CC000 N C:\Windows\syswow64\MSCTF.dll
76330000 S 00012000 N C:\Windows\syswow64\DEVOBJ.dll
76350000 S 000A0000 N C:\Windows\syswow64\advapi32.dll
76450000 S 00135000 N C:\Windows\syswow64\urlmon.dll
76590000 S 00005000 N C:\Windows\syswow64\PSAPI.DLL
765E0000 S 0015C000 N C:\Windows\syswow64\ole32.dll
76740000 S 00057000 N C:\Windows\syswow64\SHLWAPI.dll
767A0000 S 00100000 N C:\Windows\syswow64\USER32.dll
768A0000 S 00090000 N C:\Windows\syswow64\GDI32.dll
76930000 S 00046000 N C:\Windows\syswow64\KERNELBASE.dll
76980000 S 00083000 N C:\Windows\syswow64\CLBCatQ.DLL
76A10000 S 0008F000 N C:\Windows\syswow64\OLEAUT32.dll
76AA0000 S 0011C000 N C:\Windows\syswow64\CRYPT32.dll
76C40000 S 00035000 N C:\Windows\syswow64\WS2_32.dll
76D10000 S 00027000 N C:\Windows\syswow64\CFGMGR32.dll
76D40000 S 0002D000 N C:\Windows\syswow64\WINTRUST.dll
76D70000 S 000AC000 N C:\Windows\syswow64\msvcrt.dll
76E20000 S 001F9000 N C:\Windows\syswow64\iertutil.dll
773F0000 S 0000C000 N C:\Windows\syswow64\MSASN1.dll
77420000 S 00180000 N C:\Windows\SysWOW64\ntdll.dll

15
As the topic states, I'm searching for a function like FindPlayer, if a player's name is "Xmair" you just use "ma" and it'd find the instance. Help is appreciated.