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 - Sebastian
1
Videos & Screenshots / [Showoff] Proper NOS Effect.
« on June 29th, 05:05 PM »
2
Vehicle Showroom / [.xml] Tricks, Discoveries and Joy
« on June 9th, 04:52 PM »
I've made this post so I can share what I've found, with you.
Don't know how many of you know, but you can play with the engine more than R* did when about special features of vehicles.
Didn't test too much, but will update when I have news.
Also, if you have your own discoveries, feel free to share. Will put it in the list.

Flags calculator: https://vc-flags.netlify.com/
Original Author: @maxorator
Modified by: @MEGAMIND



1. Emergency Lights/Taxi Light can be used even if the vehicle is not properly categorized

Take the Flying Delly as example.
All you need to do, is adding this <specials></specials> category and play with the settings inside, like colors, position, if the lights should be turned on all the time or not, etc
(click to show/hide)
Code: [Select]
<specials>
<taxilight>
<alwayson>false</alwayson>
<colour>128,128,0</colour>

<position>
<x>0.0</x>
<y>0.0</y>
<z>0.95</z>
</position>
</taxilight>
</specials>
(click to show/hide)
Code: [Select]
<specials>
<emlights>
<alwayson>true</alwayson>
<colourone>50,255,50</colourone>
<colourtwo>50,50,255</colourtwo>

<posleft>
<x>-0.750687</x>
<y>-2.64971</y>
<z>-0.147924</z>
</posleft>

<posright>
<x>0.750687</x>
<y>-2.64971</y>
<z>-0.147924</z>
</posright>
</emlights>
</specials>
(click to show/hide)
Code: [Select]
<specials>
<emlightsingle>
<alwayson>false</alwayson>
<colour>70,70,255</colour>

<position>
<x>0.4</x>
<y>0.6</y>
<z>0.3</z>
</position>
</emlightsingle>
</specials>



2. Heli weapons will work only with heli flags, in .xml

Simple: Even with the weapons code inserted, weapons won't be active, if you use different flags than heli's.
So, in order to use Hunter's weapons, you gonna add heli's flags + specials + helidata.
Then, via script, you can play how much you want with the flags, because when you gonna reset the flags to heli's, weapons will be still working.

Heli's flags:
Code: [Select]
<flags>08028000</flags>
(click to show/hide)
Code: [Select]
<helidata>
<helitype>hunter</helitype>
<weapons>hunter</weapons>
<rotorradius>6.150000</rotorradius>
<rotordammult>0.500000</rotordammult>
</helidata>

<specials>
<heliweps>
<missilepos>
<x>2.5</x>
<y>1.0</y>
<z>-0.5</z>
</missilepos>

<machinegunpos>
<x>0.0</x>
<y>4.8</y>
<z>-1.3</z>
</machinegunpos>
</heliweps>
</specials>
(click to show/hide)
Code: [Select]
<helidata>
<helitype>water</helitype>
<weapons>sparrow</weapons>
<rotorradius>5.150000</rotorradius>
<rotordammult>0.800000</rotordammult>
</helidata>

<specials>
<heliweps>
<machinegunpos>
<x>0.0</x>
<y>4.8</y>
<z>-1.3</z>
</machinegunpos>
</heliweps>
</specials>



Notes:
  • you cannot mix lights styles (e.g.: taxi light with some emergency lights)
  • light style + heli weapons is posible
  • you can use special lights on helicopters too - don't know about the others, but it must work also. (boat tested, but no lights shown up)
  • even if you trick the flags, like I did with the Flying Delly, you cannot make weapons work when vehicle is a car.
    It must be helicopter.

(click to show/hide)
https://i.imgur.com/c7JhcDf.png - helicannon + lights



PS:
<author></author> setting acutally does something,
so when using downloaded vehicles in your server, don't forget to add the setting and the name.
3
Vehicle Showroom / [BTTF] Flying Delly - Featured Vehicle
« on June 4th, 12:08 PM »

Version: v1 Beta
Vehicle author: Spartan 112
I edited it to make it fit properly when car, but when helicopter mod too.

In order to make the switch between car and heli, you need to use the following code:
Code: [Select]
                if( veh.Model == 6440 )
                {
                    if( veh.GetHandlingData( 28 ) == -2 )
                    {
                        veh.SetHandlingData( 28, 10 );
                        return 0;
                    }
                    else if( veh.GetHandlingData( 28 ) == 10 )
                    {
                        veh.SetHandlingData( 28, -2 );
                        return 0;
                    }
                    else
                    {
                        veh.SetHandlingData( 28, 10 );
                    }
                }

Now, you can apply it by Binding a Button, to have the best experience posible. :P
Have fun!

Note: Stop the car before switching to the heli mod. Otherwise, it will continue to work as a car.
It's the game engine, nothing to do, except forcing the car's stop through script.


4
Clans and Families / [ ReadMe.txt ] YES, EVEN HERE !
« on February 23rd, 02:25 AM »
Seems like new guys need to know what's going on in this board, as I've seen numerous totally off-topic.
Besides off-topic, I've also seen players tryin' to "create" a clan where they were the only members.

As a first rule, I would like to say:
ANNOUNCING YOUR CLAN IS NOTHING LIKE CHECKING THE "I AGREE THE TERMS AND CONDITIONS" BOX
A clan must mean something, and not just a name !

So here comes the second rule:
CLAN MUST BE FAMILY
If you gonna read the definition of 'family', you will see that it is a group of people.
So YOU JUST CANNOT be the only one member !
Before announcing your clan, as a newbie lookin' for attention, go ahead and play - make friends, relationships.
Find guys who have the same purposes as you do, and make team with them !
Only then you can return here and announce it, if you and your mates dare to get more into the core !
As your name is, so the clan tag is. People won't forget your name nor your tag. So everything you do, will also affect the clan itself.

DECIDE WHAT IS THE PURPOSE OF YOUR CLAN
There are 3 types of clans: The Good, The Bad, and The Ugly
The Good - good intentions in making a good name, recruiting players, training them, treating them like family, being organized, ready to show what are made of, no matter what. Bright future ahead.
The Bad - a bunch of guys/kids thinking it will be fun to have their own clan; it's not a bad thing, as far as they don't announce it, because they are not taking it seriously.   It's all a play, so there is no name. No organization, no plains, no future.
The Ugly - hackers and cheaters, trying to ruin other players' gameplay. Bright BAN ahead.

SUPPORT
If you have decided yourself, and have the trusted people around, go ahead and announce it as a real leader !
Make visitors eyes-open when reading your announcement; tell them what it takes to be a member, and also what to expect from the clan. Convince them to join! It's so much about the first-view.
Then keep them up to date with everything, and so this topic, so everybody can see who has been promoted or depromoted, if it is still alive or not, etc.

I truly wish you the best !

There are some very serious clans in VC:MP, with long history. Just try to take a look at the board.
There are events taking place every year, where clans give their best to show what are they up to. Fighting, making every moment count.

Last rule: There is no rule saying that clans must be ONLY for deathmatching. You might not like fighting, but you like stunting, drifting. :P
5
Hey there !

I know there are servers which comunicate to Discord channels,
so I have to ask, as I'm gonna need it:
HOW TO ?

There is a Discord plugin for javascript plugin, made by @NewK , so everybody can make it happen.
Can somebody do one for Squirrel too ?
6
Tutorials / [howto] I/O functionality
« on July 29th, 2018, 11:35 AM »
// this was posted long time ago by SLC; had to be stickied even since
Quote from . on December 8th, 2015, 12:47 PM
The Squirrel standard library offers IO functionality. It's just a little more complicated for new users that don't know to process files in binary mode.

To open a file we use the file type constructor and pass the file name and desired flags/modes that we want to use when opening that file. Flags/modes are the similar to the C modes from fopen.

Code: [Select]
local myfile = file("text.txt","rb+");

In this case 'b' tells us that we open the file on binary mode and 'r+' allows us to both read and write/update to the file. The file must exist!

Then we use the readn(type); member function to read each byte from that file.

Code: [Select]
local my_str = "";

while (!myfile.eos())
{
    my_str += format(@"%c", myfile.readn('b'));
}

print(my_str);

We begin by creating a string variable `my_str` where we store the resulted string. Then we use the `eos()` (end of stream) member function to know when we reached the end of the file. If we reached the end of the file then `eos()` will return something different from null.

Then we read a single byte and since ASCII characters occupy a single byte that means we read a single character from the file. But a byte is nothing but a number. So we use the format function to convert that byte into a character which becomes a string. And we add the returned string which contains a single character to the actual string.

The list of values that you can read are as follows:
  • 'i' 32bits number returns an integer
  • 's' 16bits signed integer returns an integer
  • 'w' 16bits unsigned integer returns an integer
  • 'c' 8bits signed integer returns an integer
  • 'b' 8bits unsigned integer returns an integer
  • 'f' 32bits float returns an float
  • 'd' 64bits float returns an float

After that we print the retrieved text from the file. To write to a file we use the writen(type); member function which works just like the read function except it writes values.

Code: [Select]
local my_text = "Appended text goes here";

myfile.seek(0, 'e');

foreach (c in my_text)
{
    myfile.writen(c, 'b');
}

We begin by creating a dummy text string that will be appended to our current text. Then we move the cursor to the end of the file. We do that by seeking 0 bytes past the endpoint.

Then we use a foreach loop to process each character in our string. And since one ASCII character is one byte then we write them each as one byte.

The list of values that you can write are as follows:

  • 'l' processor dependent, 32bits on 32bits processors, 64bits on 64bits prcessors
  • returns an integer 'i'
  • 32bits number 's'
  • 16bits signed integer 'w'
  • 16bits unsigned integer 'c'
  • 8bits signed integer 'b'
  • 8bits unsigned integer 'f'
  • 32bits float 'd'
  • 64bits float

After we're done with the file we use the `close()` member function to close it and that's it.

Code: [Select]
myfile.close();



I suppose the whole code can be summarized into two simple read/write functions:
Code: [Select]
function ReadTextFromFile(path)
{
    local f = file(path,"rb"), s = "";

    while (!f.eos())
    {
        s += format(@"%c", f.readn('b'));
    }

    f.close();

    return s;
}

function WriteTextToFile(path, text)
{
    local f = file(path,"rb+"), s = "";

    f.seek(0, 'e');

    foreach (c in text)
    {
        f.writen(c, 'b');
    }

    f.close();
}

And used as:
Code: [Select]
print( ReadTextFromFile("test.txt") );

WriteTextToFile("test.txt", "Appended text goes here");

print( ReadTextFromFile("test.txt") );



I suppose the whole read function can also be optimized with a blob to avoid a ton of IO operations for a single byte.

Code: [Select]
function ReadTextFromFile(path)
{
    local f = file(path,"rb"), s = "", n = 0;
    f.seek(0, 'e');
    n = f.tell();
    if (n == 0)
        return s;
    f.seek(0, 'b');
    local b = f.readblob(n+1);
    f.close();
    for (local i = 0; i < n; ++i)
        s += format(@"%c", b.readn('b'));
    return s;
}
Also, SLC is sharing a function for reading between strings of a text:
Code: [Select]
// Assuming `text`, `begin_str` and `end_str` are all strings. no error checking

function GetTextBetween(text, begin_str, end_str, must_end = true) {
  // See where `begin_str` starts in the `text`
  local start_idx = text.find(begin_str, 0);
  // if `start_idx` is `null` then it wasn't found
  if (start_idx == null) {
    return null;
  }
  // Exclude `end_str` from the returned string
  start_idx += begin_str.len();
  // See where `end_str` starts in the `text`
  // Starting the search after where `begin_str` was located
  local end_idx = text.find(end_str, start_idx);
  // if `start_idx` is `null` then it wasn't found
  if (end_idx == null) {
    // If the end string must be present
    if (must_end) {
      return null; // Then return null
    // If the end string doesn't have to be present
    } else {
      // Return everything after `begin_str` (excluding `begin_str`)
      return text.slice(start_idx);
    }
  }
  // We have a beginning and an ending, so get that slice of text
  return text.slice(start_idx, end_idx);
}
7
Can somebody list all the risks of not using this function ? according to VC:MP.
I'm pretty sure this kind of topic will be helpful for much part of the comunity.
8
Client Scripting / [function] qGUI
« on June 10th, 2018, 01:01 AM »
I do need it, to avoid lots of useless code lines.
I'm sharing it, for people who might need it too.



We all know what's needed to create a basic .... label.
(click to show/hide)
        Account.Label4 = GUILabel( );
        Account.Label4.Pos = VectorScreen( 90, 280 );
        Account.Label4.FontSize = 12;
        Account.Label4.TextColour = Colour( 221, 221, 88 );
        Account.Label4.FontFlags = ( GUI_FFLAG_BOLD );
        Account.Label4.Text = "auto-login enabled";

6 damn code lines.
What if we gonna create a GUI Register system ? PLENTY of code, which can be shortened a lot.
So what do you say about 1 code line, instead of 6 ? :D
Much better!



I have created a function which does the job, with all the details you need.
For now, it includes code lines for Window, Label, Button, Checkbox, Editbox.
(which I believe are the most used ones so far)

Parameters
Window - qGUI( "window", pos, size, rgb, text, text_rgb, font_size, font_flags, remove_flags )
Label - qGUI( "label", pos, text_size, text_rgb, text, font_flags, font_name )
Button - qGUI( "button", pos, size, rgb, text, text_rgb, font_flags )
Checkbox - qGUI( "checkbox", pos, size, rgb )
Editbox - qGUI( "editbox", pos, size, rgb, text, text_rgb, flags )
(with green are optional arguments)

So here it is:
Code: [Select]
function qGUI( type, ... )
{
    if( vargv.len() >= 3 )
    {
        local   q = 0,
                pos = vargv[0],
                size = vargv[1],
                rgb = vargv[2];
               
        switch( type )
        {
            case "window":
            {
                q = GUIWindow();
               
                local   text = vargv[3].tostring(),
                        textrgb = vargv[4],
                        fontsize = vargv[5];
               
                q.Pos = pos;
                q.Size = size;
                q.Colour = Colour( rgb.R, rgb.G, rgb.B, 255 );
                if( rgb.A ) q.Alpha = rgb.A;
               
                q.Text = text;
                q.TextColour = Colour( textrgb.R, textrgb.G, textrgb.B );
                q.FontSize = fontsize;
               
                if( vargv.len() >= 7 ) q.FontFlags = ( vargv[6] );
                if( vargv.len() >= 8 ) q.RemoveFlags( vargv[7] );
            }
            break;
           
            case "label":
            {
                q = GUILabel();
               
                local   text = vargv[3].tostring();
                       
                q.Pos = pos;
                q.FontSize = size
                q.TextColour = Colour( rgb.R, rgb.G, rgb.B );
                q.Text = text;
               
                if( vargv.len() == 5 ) q.FontFlags = ( vargv[4] );
                if( vargv.len() == 6 ) q.FontName = vargv[5];
            }
            break;
           
            case "button":
            {
                q = GUIButton();
               
                local   text = vargv[3],
                        textrgb = vargv[4];
               
                q.Pos = pos;
                q.Size = size;
                q.Colour = Colour( rgb.R, rgb.G, rgb.B );
                q.Text = text;
                q.TextColour = Colour( textrgb.R, textrgb.G, textrgb.B );
               
                if( vargv.len() == 6 ) q.FontFlags = ( vargv[5] );
            }
            break;
           
            case "checkbox":
            {
                q = GUICheckbox();
               
                q.Pos = pos;
                q.Size = size;
                q.Colour = Colour( rgb.R, rgb.G, rgb.B );
            }
            break;
           
            case "editbox":
            {
                q = GUIEditbox();
               
                q.Pos = pos;
                q.Size = size;
                q.Colour = Colour( rgb.R, rgb.G, rgb.B );
               
                if( vargv.len() >= 4 ) q.Text = vargv[3];
                if( vargv.len() >= 5 ) q.TextColour = Colour( vargv[4].R, vargv[4].G, vargv[4].B );
                if( vargv.len() == 6 ) q.AddFlags( vargv[5] ); // like GUI_FLAG_EDITBOX_MASKINPUT
            }
            break;
        }
        if( q != 0 ) return q;
        else return srv_print( "GUI couldn't be created." );
    }
}



PS: I know I could set the pos and size and colour overall, by using just 3 lines.
But I preferred not to.
9
Scripting and Server Management / GUI CreateWindow() function
« on June 5th, 2018, 03:28 PM »
Hey there!

I'm looking forward for an overall function when creating GUI elements;
something like:
Code: [Select]
CreateWindow( size, colour, pos, text, textcolour, fontsize )

I tried my luck, but for some reason, it doesn't show up at all...
Code: [Select]
function qGUI( type, ... )
{
    switch( type.tostring() )
    {
        case "window":
        {
            local   q = GUIWindow(),
                    size = vargv[0],
                    colour = vargv[1],
                    pos = vargv[2],
                    text = vargv[3].tostring(),
                    textcolour = vargv[4],
                    fontsize = vargv[5];
                   
            q.Size = size;
            q.Colour = colour;
            q.Pos = pos;
            /* GENERAL */ q.FontFlags = ( GUI_FFLAG_BOLD );
            /* GENERAL */ q.RemoveFlags( GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_WINDOW_CLOSEBTN );
            q.Text = text;
            q.TextColour = textcolour;
            q.FontSize = fontsize;
       
        break;
        }
}

If I do it in the classic way (one-by-one function for every setting) it will work.
What's going on ? How can I make it work ?
10
Closed Bug Reports / [bug] “broken cd”
« on June 3rd, 2018, 02:16 PM »
Just reminding...
It is a nightmare.
Quote from maxorator on June 25th, 2017, 01:20 PM
The radios work by using a global time counter anyway, which determines the position for every radio. Basically it would just mean having a server-wide sync of that counter (technically making it use a new counter and sync that, so it would not affect other things).
http://forum.vc-mp.org/?topic=4837.msg35409#msg35409
11
Tutorials / [tut] Placing 2dfx light on your custom object
« on June 1st, 2018, 11:54 PM »
Hey there!
I was gonna place some 2dfx lights today, and I was like "why not recording a tutorial?"
I'm pretty sure there are a lot of guys not able to, so this will help them out.

BLENDER software will offer you the needed coords.


https://youtu.be/QkSZR9mbsHA


2DFX Documentation
12
Closed Bug Reports / [bug] timed custom objects won't show up
« on August 8th, 2017, 10:37 PM »
Description
Let's take night neons as example. You set a custom neon to appear at 8pm and disappear at 5am.
If you join the server when the neon is visible, you won't be able to see it at all, nor if the time will be set to 7pm then back to 8pm.
It will just not stream for you at all.
You must join the server before 8pm or after 5am.

Reproducible
Always
13
Tutorials / [tut] Objects are constantly appearing/dissappearing
« on July 23rd, 2017, 06:42 AM »
I even forgot about this, until I reinstalled windows.

What's happening? Most of the objects are warping, just like in this video:


https://youtu.be/7hiaR7Xrgoo

To fix that, you have to go in any server and use this command:
Code: [Select]
/setconfig game_streammem 512

Credits: TheKilledDead and @PunkNoodle
Old post: here
14
Videos & Screenshots / [event] Halloween Flashbacks
« on June 10th, 2017, 04:10 AM »
a remake, based on the only records I've ever kept

https://youtu.be/4zQKBcjAEsU
15
Bugs and Crashes / [BUG] hi-jack enables player's colision
« on June 9th, 2017, 05:54 PM »
Description
Remember that old trick to hi-jack a car ? where a car was unable to be entered by driver's door and needed to be done by passenger's one, while it was occuppied by a player ?
Well, do that and ped's colision will be enabled.

Reproducible
Always

What you were doing when the bug happened
Testing

What you think caused the bug
VCMP detected the player out of car, and enabled it's colision ?

Video

https://youtu.be/Hh4FyjyOfpo