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.

Messages - AroliS^
1
Snippet Showroom / [Release] ADiscord Library
« on August 24th, 09:56 PM »
ADiscord

A Nodejs Library for connecting a VC MP server over sockets to Discord
Since Discord plugins weren't fully functional at all.  and I got few DM's that they were in the need of a library I decide to create a fully function library where everybody somehow can collaborate :) Enjoy it


Everybody is more than welcome to collaborate. Didn't have the time to do a deep test.
If you encounter any bugs/errors just let me know and I will fix it as soon as possible

Github Wiki
Github Repository

.
 
Quick Code Lookup
Code: [Select]
             // client
ADiscord.user.send (player.Name + ": " + text, "846106037790179398");

ADiscord.user.messageEmbed ({
Title = player.Name,
Description = "replied: " + text
}, "846106037790179398")
               
           // message listener
       addEventHandler.on ("message", function (message) {
           if (message.channel.id == "846106037790179398" || message.channel.name == "General")
                          message.channel.send ("HI " + message.author.username);
       }
2
Nice work!
3
General Discussion / Re: Do you guys miss 0.3?
« on September 4th, 2021, 08:31 PM »
Quote from Athanatos on September 4th, 2021, 07:25 PM
So you all guys say that you miss the old 0.3 community eh?
that's right my small grasshopper
4
Client Scripting / Re: Kaboom - 2d Game Development.
« on July 22nd, 2021, 02:19 AM »
new game: Pac - man
Code: [Select]
local Kaboom = Kab ({
    id = "pacman"
    loadRoot = "kaboom/"
}) 

local obj = {
    "|": {
        square      = true
        alias       = "blocks"
        solid       = true
    }

    "-": {
        square      = true
        alias       = "blocks"
        solid       = true
    }

    ".": {
        square      = true
        alias       = "points"
        solid       = true
        Size = VectorScreen (10,10)
        Colour = Colour (255,0,0)
    }   
 
    "_": {
        square      = true
        alias       = "door"
        solid       = true
        Size = VectorScreen (0,10)
        Colour = Colour (0,0,255)
    } 

    "@": {
        square      = true
        alias       = "bigpoints"
        solid       = true
        Size = VectorScreen (20,20)
        Colour = Colour (255,0,255)
    }       
}

local map = [
    "|------------------------------------------------------------------------------|"
    "|                                                                              |"
    "| . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @  |"
    "| @ - . -------- . --------------------------   ---------   ------   --   --   |"
    "| . - . -------- .                                          ||  ||             |"
    "| .   . ||          . . . . . . .  . . . . . .              ||  ||             |"
    "| . . . ||  . . . .  ---------  .  --------- .              ||  ||             |"
    "|---  . ||  .     .  ||     ||  .  ||     || .  ---___---   ||  ||          ---|"
    "   |  . ||  .     .  ||     ||  .  ||     || .  ||     ||   ||  ||          |   "
    "----  . ||  . --- .  ||     ||  .  ||     || .  ||     ||   ||  ||          ----"
    "      . ||  .  || .  ||     ||  .  ||     || .  ||     ||   ||  ||              "
    "      . ||  .  || .  ||     ||  .  ||     || .  ||     ||   ||  ||              "
    "----  . ||  @  || .  ||     ||  .  ||     || .  ---------   ||  ||          ----"
    "   |  . ||-----|| .  ||     ||  .  ||     || .              ||  ||          |   "
    "|---  . --------- .  ---------  .  --------- .              ------          ---|"
    "|                                                                              |"
    "| . . . . . . . . . . . . . . . . . . . . . . .  -------  . . . . . . . . .  . |"
    "| . --   -------------- . | . --------------                ----------   --  . |"
    "| .                     . | .                                                . |"
    "| @ . . . . . . . . . . . | . . . . . . . . . .  |     |  . . . . . . . . .  @ |"
    "|------------------------------------------------------------------------------|"
]
 
Kaboom.scene ("one", function () {
    config ({
        bgcolor = [0,0,0]
        sceneBorder = true
        Size = VectorScreen (1500,500)
    });
 
    addLevel (map, obj);
    local up = array(5, null), down = array(5, null), left = array(5, null), right = array(5, null);
    local getAnimPos = function (x, y) {
        if (x == -5) return 0;
        if (x == 5) return 1;

        if (y == 5) return 2;
        if (y == -5) return 3;
    }
 
    local getItWork = function (entity, Id) {
        local pos = [{X = 5, Y = 0}, {X = -5, Y = 0}, {X = 0, Y = 5}, {X = 0, Y = -5}];
        local random = function (start, finish) return ((rand() % (finish - start)) + start);
       
        if (entity.props ().getBumpHeading () == "up") {
            if (up [Id]) entity.move2d (up [Id].X, up [Id].Y);
            else {
                up [Id] = pos[random (0, 4)];
                if (up [Id].Y == -5) up [Id] = null;
            }

            down  [Id]  = null;
            left  [Id]  = null;
            right [Id]  = null;

                // animations
            if (up [Id]) entity.playAnim ([getAnimPos (up [Id].X, up [Id].Y)]);
        }

        else if (entity.props ().getBumpHeading () == "down") {
            if (down [Id]) entity.move2d (down [Id].X, down [Id].Y);
            else {
                down [Id] = pos[random (0, 4)];
                if (down [Id].Y == 5) down [Id] = null
            }

            up    [Id]  = null;
            left  [Id]  = null;
            right [Id]  = null;

                // animations
            if (down [Id]) entity.playAnim ([getAnimPos (down [Id].X, down [Id].Y)]);
        }       
        else if (entity.props ().getBumpHeading () == "left") {
            if (left [Id]) entity.move2d (left [Id].X, left [Id].Y);
            else {
                left [Id] = pos[random (0, 4)];
                if (left [Id].X == -5) left [Id] = null;
            }

            up    [Id]  = null;
            right [Id]  = null;
            down  [Id]  = null; 

                // animations
            if (left [Id])  entity.playAnim ([getAnimPos (left [Id].X, left [Id].Y)]);
        }
       
        else {
            if (right [Id]) entity.move2d (right [Id].X, right [Id].Y);
            else {
                right [Id]= pos[random (0, 4)];
                if (right [Id].X == 5) right [Id]= null
            }

            up   [Id]  = null;
            left [Id]  = null;
            down [Id]  = null;   

                // animations
            if (right [Id]) entity.playAnim ([getAnimPos (right [Id].X, right [Id].Y)]);   
        }
    }

    local enemy = addEntity ({
        uniqueId    = "enemy1"
        spriteId    = "pacsheet"
        Pos         = getPos (18,30)
        Size = VectorScreen (35,35)

        spritesheet = { 
            Id  = 0, // will reproduce sprite id 5 in sprite sheet
            UV  = VectorScreen (64, 64),
            X   = 0.25,
            Y   = 0.5
        }
        solid   = true
        alias = "enemy"
        Ignore = [ "points", "bigpoints" ]
    })

    local enemy2 = addEntity ({
        uniqueId    = "enemy2"
        spriteId    = "pacsheet"
        Pos         = getPos (10,30)
        Size = VectorScreen (35,35)

        spritesheet = { 
            Id  = 0, // will reproduce sprite id 5 in sprite sheet
            UV  = VectorScreen (64, 64),
            X   = 0.25,
            Y   = 0.5
        }
        solid   = true
        alias = "enemy"
        Ignore = [ "points", "bigpoints" ]
    })   

    local Index = 0;
    enemy.action (function () {
        if (entity.collect ().has ("coloured"))  {
            enemy.Colour = Colour (rand () * 255, rand () * 255, rand () * 255 );
            enemy2.Colour = Colour (rand () * 255, rand () * 255, rand () * 255 );
           
            game.Timeout (function () {
                    // enemy 1
                enemy.collect ().remove ("coloured");
                enemy.Colour = Colour (255,255,255); // returning original colour
 
                    // enemy 2
                enemy2.collect ().remove ("coloured");
                enemy2.Colour = Colour (255,255,255); // returning original colour
            }, 100)
        }
 
        getItWork (entity, 0); 
    })
    enemy2.action (function () { getItWork (entity, 1); })

    local pac = addEntity ({
        uniqueId    = "pac"
        spriteId    = "pacsheet"
        Pos         = getPos (18,51)
        Size        = VectorScreen (35,35)

        spritesheet = { 
            Id  = 5, // will reproduce sprite id 5 in sprite sheet
            UV  = VectorScreen (64, 64),
            X   = 0.25,
            Y   = 0.5
        }
        solid   = true
        player  = true
    })

    pac.action (function () {
        Key ("right", function () {
            if (event == "down") {
                entity.move2d (5, 0);
                entity.playAnim ([6,5,4], {
                    animSpeed = 0.5
                })
            }
        })

        Key ("left", function () {
            if (event == "down") {
                entity.move2d (-5, 0);
                entity.playAnim ([6,5,4], {
                    animSpeed = 0.5
                    mirror = true
                })
            }
        })

        Key ("up", function () {
            if (event == "down") {
                entity.move2d (0, -5);
                entity.playAnim ([6,5,4], {
                    animSpeed = 0.5
                    rotate = "up"
                })
            }
        })

        Key ("down", function () {
            if (event == "down") {
                entity.move2d (0, 5);
                entity.playAnim ([6,5,4], {
                    animSpeed = 0.5
                    rotate = "down"
                })
            }
        })       
    })

    pac.collides ("points", function () {
        hit.entity.destroy2d ();
    })

    pac.collides ("bigpoints", function () {
        hit.entity.destroy2d ();

        // add the 'data' coloured to the collection of the entity for an enemy effect.
        enemy.collect ().set ("coloured", true);
        enemy2.collect ().set ("coloured", true);
    })

    pac.collides ("enemy", function () {
        local obj = hit.entity;
        if (obj.collect ().has ("coloured")) {
            obj.hide ();
        }
        else {
            entity.destroy2d ();
        }
    })

    render (function () {
        pac.render ();
        enemy.render ();
        enemy2.render ();
    })
})

Kaboom.start ("one");



spritesheet: https://i.imgur.com/RdV1iXP.png

remember to download the lastest version of Kaboom.
as all game done by me, aren't finished yet. so, keep tuned for the updates of these games and the Kaboom class.
5
Client Scripting / Re: Kaboom - 2d Game Development.
« on July 21st, 2021, 05:21 AM »
Hi, Im here once more time!

Kaboom have been rewritten, which now is more stable and more efficienty.
spritesheet have been added, all credits goes to DMWarrior, which I just took his function and rewrite it to Kaboom.
now, It's possible to move among stages see the video - https://i.imgur.com/rbLjznx.mp4

This is such a big update, please check github for more information.

Sample games
mario was the only game rewritten for this new version.

sprites list: https://imgur.com/a/z0y1Eie
6
Client Scripting / Kaboom - 2d Game Development.
« on July 5th, 2021, 06:00 AM »
based on Kaboom.js



Kaboom.nut its a squirrel library that helps you make fast and easy 2d games.
For documentation and Installation guide check out Kaboom.nut github

Scene
Scenes are the different stages of a game, like different levels, menu screen, and start screen etc. Everything belongs to a scene.

Code: [Select]
scene("level1", () => {
     config ({
      })
});

scene("level2", () => {
     config ({
      })
});

scene("gameover", () => {
     config ({
      })
});
start("level1"); // starting first level



Mario


game code: https://github.com/AroliSG/Kaboom/blob/main/Examples/mario.nut


Pac-man


game code: https://github.com/AroliSG/Kaboom/blob/main/Examples/pacman.nut


Plat-form


game code: https://github.com/AroliSG/Kaboom/blob/main/Examples/platform.nut


Transform


game code: https://github.com/AroliSG/Kaboom/blob/main/Examples/transform.nut



Warnings

  • collision its not perfect with gravity games. 'Looking forward for future improvements'
  • before using any example make sure, all sprites are located at sprite/kaboom/.
  • this topic will be updated periodically, but stay tuned on github.
  • when using gravity with objects. You shouldn't use pos.Y which will overpass the wall/objects body, you should use 'Jump ()'


Important: Library still under development, if you have found a bug. Feel free to create an issue on github.
Feel free to leave your feedback,

what games can we make with this library?
As far as your imagination can go.
If you would like to assist this project, follow the github and pull request any time.


I have made a file of sprites
7
Client Scripting / [Release] Re: DecUI: A declarative approach to UI development
« on May 16th, 2021, 01:37 AM »
remember to check out the github, for viewing out new updates..
8
Script Showroom / [Release] Mailer Lite
« on April 13th, 2021, 03:03 AM »
Mailer by AroliS^



- What it is? Mailer is a VC-MP Library that allows you to send emails from your server with ease. Whether you want to communicate with your users or just notify yourself when something has gone wrong, one of the options for doing so is through mail



- How to use it?
1. download the file here
2. need to create an account -> here
3. need to place this on onScriptLoad
-- Loading the file
Code: [Select]
dofile( "scripts/mailer.addon" );

-- Creating the connection
Code: [Select]
mailer.Create ("mail.smtp2go.com", "Email Address given by website", "Password given by website")
2. need to place this on onPlayerCommand and fill up the needs boxes
Code: [Select]
if (cmd=="sendemail") {
     mailer.Say ( "Email address given by website", "Sender Nick", "Receiver Email address", "Receiver Nick", "subject", @"
           body html & text
    ");
}



photos
1.


2.



plugin needed is: https://github.com/VCMP-SqMod/VCMP-Hash/releases
any suggestions or ideas are welcomes.
Support: AroliS^#4661

Happy coding <3
9
Scripting and Server Management / Re: How to use two case
« on March 23rd, 2021, 12:38 PM »
You dont need to send all Editboxes, as far as you detecting if they aren.t empty tho.

Code: [Select]
function GUI::ElementRelease(element, mouseX, mouseY)
{
switch (element)
{
case regiscom.regbut:
GUI.InputReturn(regiscom.users); //yep change that
break;
}
}

function GUI::InputReturn(editbox) // yep here also change
{
switch ( editbox) // yep here also
{
case regiscom.user: case regiscom.pas: case regiscom.repas: /////register//

if (regiscom.user.Text.len() > 0)
{
if (regiscom.pas.Text.len() > 0)
{
if (regiscom.repas.Text.len() > 0)
{
if (regiscom.pas.Text == regiscom.repas.Text)
{
SendDataToServertwo( regiscom.user.Text, regiscom.pas.Text, 70 );
}
else hihihihi(6);
}
else hihihihi(5);
}
else hihihihi(4);
}
else hihihihi(3);
break;
}
}


this shall be enough, and also try organizing your scripts.
10
http://wiki.adtec.ovh/wiki/Scripting/Squirrel/Functions/ConnectSQL

You should read the doc of sqlite

Code: [Select]
local str2 = Stream.ReadString ( ); ///this password
local q = QuerySQL(Database, "SELECT * FROM Accounts WHERE Username = '"+string+"'"); //i think here is the problem

GetSQLColumData is the method to get any colum, at your database. Everything you insert is organized by colums. try counting them and giving the number to this function for getting the information you need.

MessagePlayer("Here what is in data: "+GetSQLColumnData (q, 0),player); // the message its appears but what is inserted its appears null


this shall help you.
11
Scripting and Server Management / Re: How to use two case
« on March 23rd, 2021, 02:32 AM »
Code: [Select]
function GUI::ElementRelease(element, mouseX, mouseY)
{
switch (element)
{
case regiscom.regbut: //register boutton///
1// GUI.InputReturn(regiscom.user); //when player click register boutton he need to fill editbox first//
2// GUI.InputReturn(regiscom.pas); //but as you see here three edit box: user, pasword, repassword//
3// GUI.InputReturn(regiscom.repas); // actually i don't know if i have a problem here or no
}
}

i bet you, you can solve it by your self after this
12
Script Showroom / Arolis' Register and Login System
« on February 11th, 2021, 03:03 AM »
A multi-lang account system for beginners.


Github: https://github.com/AroliSG/Account-System

Example Script:
Code: [Select]
class pAccount {
    HeadShoots      = 0;
    Kills           = 0;
    Deaths          = 0;
    KillingSpree    = 0;
    Bank            = 0;
    Level           = 0;
    IP              = 0.0.0.0;
    UID             = null;
    UID2            = null;

    Reg             = false;
    Log             = false;

    ServerName      = "Blank Server 0.4v";
    Owner           = "LBRr.AroliS^";

    constructor(p, ...) {
        switch (vargv.len())
        {
            case 1: this.ServerName    = vargv [0]; break;
        }

        local q = ::QuerySQL(db, "SELECT * FROM [accounts] WHERE [name] = '" +p.Name+ "'");
        if (!q) {
            ::message.toPlayer (p, "Welcome to %s Server", "Bienvenido a %s Server", [ this.ServerName ]);
            ::message.toPlayer (p, "You are not registered, please proceed to register /register.", "Tu no estas registrado, porfavor procede a registrarse /registrar.");
        }
        else {
            this.Reg            = true;
            if (::GetSQLColumnData (q,3) == p.IP && ::GetSQLColumnData (q,4) == p.UniqueID && ::GetSQLColumnData (q,5) == p.UniqueID2) {
                ::message.toPlayer (p, "Welcome back to %s Server", "Bienvenido devuelta a %s Server", [ this.ServerName ]);

                    this.HeadShoots     = ::GetSQLColumnData(q, 9);
                    this.Kills          = ::GetSQLColumnData(q, 6);
                    this.Deaths         = ::GetSQLColumnData(q, 7);
                    this.KillingSpree   = ::GetSQLColumnData(q, 8);
                    this.Bank           = ::GetSQLColumnData(q, 11);
                    this.Level          = ::GetSQLColumnData(q, 13);
                    p.Cash              = ::GetSQLColumnData(q, 10);

                    this.IP             = p.IP;
                    this.UID            = p.UniqueID;
                    this.UID2           = p.UniqueID2;

                    this.Reg            = true;
                    this.Log            = true;
            }
            else {
                ::message.toPlayer (p, "Welcome back to %s Server", "Bienvenido devuelta a %s Server", [ this.ServerName ]);
                ::message.toPlayer (p, "You are not logged-in, please proceed to logg-in /login.", "Tu no haz ingresado, porfavor procede a ingresar /ingresar.");
            }
        }
    }

    SaveStats = function (p) {
        ::QuerySQL(db, @"UPDATE [accounts] SET [kills] = '" +this.Kills+ "', [deaths] = '" +this.Deaths+ "', [headshoot] = '" +this.HeadShoots+ "', [ip] = '" +p.IP+ "', [uid] = '" +p.UniqueID+ "', [uid2] = '" +p.UniqueID2+ "', "+
        "[killingspree] = '" +this.KillingSpree+ "', [money] = '" +p.Cash+ "', [bank] = '" +this.Bank+ "', [level] = '" +this.Level+ "' WHERE [name] LIKE '" + p.Name + "'" );

        print (p.Name + " quit");
    }
}



I felt in the need to create something useful, for those guys that are looking for a register and login system with a clean and multi-lang code from where to begin.

if you found any bugs, feel free to post it.

database: SQLite
Language: Squirrel

These functions are composes of printable string from a combination of string literals, format placeholders, escape sequences and non-string data values.

placeholders are not necessary as far as you dont use data type.

Code: [Select]
message.toAll (msg, msg, ..., [ format placeholders ] ); will send a message to everyone
message.toPlayer (p, msg,msg, ..., [ format placeholders ]); will send a message to player
message.toAllExcept (p, msg, msg, ..., [ format holders ] ); will send a message except to the player expecified


  • vargv points means that more languages can be added
  • how to add them? quick example above.

by accesing to the file called message.nut
  • add a new global variable called by the language name as example turkish romanian etc.
  • go down to the function named Insert.
  • add a new [else if] and continue by yourself after this point.

Code: [Select]
   
 // inserting data to our data
    Insert = function (player) {
        local e = null;
        if (spanish.find (IpToCountry (player.IP)) != null) e = 2;
        else e = 1; //pre-difining lang english as default if the player is not from any spanish country.

        this.pLang.rawset (player.ID, e);
    }


The function uses the standard C language printf format placeholders though not all of these are relevant to Squirrel’s data types. Those that are are listed in the table below:

Code   Data Type   Description
  • %x   Integer   Presents a hexadecimal number with lower-case letters
  • %X   Integer   Presents a hexadecimal number with upper-case letters
  • %o   Integer   Presents an octal number
  • %u   Integer   Presents an unsigned decimal value
  • %i   Integer   Presents a signed decimal value
  • %d   Integer   Presents a signed decimal value
  • %f   Float   Presents a decimal value in floating-point format
  • %e   Float   Presents a decimal value in scientific notation
  • %g   Float   Use the shortest representation: %e or %f
  • %s   String   Presents a string
  • %c   Integer   Presents an integer value as a character
  • %%   N/A   Percentage symbol

plugins: xmlconf04rel64 announce04rel64 squirrel04rel64 sqlite04rel64 hashing04rel64

Happy coding by your good friend Arolis <3
13
Quote from UncleRus on April 22nd, 2020, 08:45 AM
I personally need not a local hosting but a global one
i can give you vps, send me a message on Discord LBRr.AroliS^.
14
Scripting and Server Management / Re: Need Pack in every spawn.
« on April 4th, 2020, 04:55 PM »
Code: [Select]
packs <- array(100,null);
else if (cmd =="pack1")
{
    if ( packs[ player.ID ] != 1 )
    {
        MessagePlayer("[#ff0047]You took [#ffffff]PACK 1!",player);
        packs[ player.ID ] = 1
    }
    else MessagePlayer( "fffffff, You already have this pack.",player);
}

///onplayerspawn
   
switch(packs[ player.ID ])
{
    case 1:
    {
        player.Disarm();
        player.SetWeapon(21,10000);
        player.SetWeapon(26,10000);
        player.SetWeapon(24,10000);
        player.SetWeapon(17,10000);
    }
    break;
}
15
Client Scripting / Re: Animated GUISprites
« on March 31st, 2020, 04:41 PM »
Awesome!