Recent Posts
1
Client Scripting / [Repost] Re: Snow Effect
« on January 21st, 09:03 AM by ℛḝξ☂ »
Great work dude!
2
General Discussion / [TOOL] Re: Ipl Hide
« on January 19th, 02:04 AM by Kenneth Law »
Sorry for the bump but I have difficulty downloading the tool. Could you please upload it again via some other sources or send the files directly to me? :'(
Great appreciation for it!
3
Both games are good, GTA SA and GTA Vice City never gets old. :P But how will GTA DE stack up against gta vice city? The new GTA loads very fast, good graphics and feels awesome, how will gameplay be against the older gta versions?

In gta vice city you can also have good graphics, smooth gameplay, it all depends on what computer you have.

What you guys think GTA SA DE or GTA Vice CIty, which one has better graphics and gameplay? ;)

I will write more about GTA Vice City and Vc-mp on my site, https://owlgang.uk.ms/, we're about to put a blog on the site soon since I've played the game for a long time and I do wanna share my thoughts. :)
4
Clans and Families / [oK] - Owl Killers [oK]gang
« on January 17th, 12:53 PM by NoxxeR »
I'm about to start this new clan, it's for GTA Sa Definitive edition, MTASA, and for sa-mp, vc-mp.
 
Website:
 
https://owlgang.uk.ms
 
Clan members:
 
[oK]NoxxeR - Clan Leader
 
 
Information:
 
If you're not already in a clan then PM me on our the website forums and I will add you in the clan, I'm looking for skilled players as well.

A forum is about to be created.
The website will be updated as we speak all the time.

This clan will gangwar other clans in mtasa, samp, etc, write on our forums about your gang first.


// NoxxeR
5
Script Showroom / [Release] Command Manager for VCMP
« on January 15th, 07:28 PM by umar4911 »
Command Manager


I had this command manager scripted long ago which I used in my old squirrel-based projects. Complete credits go to SLC as this command manager is a replica of the SqMod command manager and has a function of getting argument type made by him.




Installation

Code: [Select]
function onScriptLoad()
{
    CPlayer.rawnewmember("Authority", 1);
    dofile("CMD_Manager.nut", true);
}


function onPlayerCommand(player, cmd, arguments)
{
    local str = cmd + (arguments == null ? "" : " " + arguments);
    if(cmd != "") CMD_Manager.Run(player, player.Authority, str);
}



The code for CMD_Manager.nut can be found on the Github Repository.




Usage


Creating command

The syntax to create a command is:
Code: [Select]
CMD_Manager.Create(command, args_type, args_array, min_args, max_args, auth, protected, assoc)

Understanding the parameters

First argument is the command name.

Second are the command masks for each argument. At the moment it supports the following specifiers:

i The argument accepts integer.
f The argument accepts floating point number.
b The argument accepts boolean.
s The argument accepts string.
g This argument is a greedy argument. Anything after this argument is captured as a string and no further parsing is done.

And you can combine them if one argument accepts multiple types of values.

Let's say that your command expects integer or float for the first argument, boolean for the second, uppercase string for the third and integer, float or boolean for the fourth. Then your mask should be like:

Code: [Select]
"if|b|u|ifb"
That way the command system knows how to parse the parameters and what values to expect.

Third argument is an array of argument names.  For example, let's say I'm creating a register command with 3 arguments. I'll probably specify ["name", "password", "email"].

The fourth and fifth argument is the minimum and maximum arguments that the command needs. When calling the command you only need the minimum and the rest is optional. You can have up to 16 arguments. I believe that's a fair number.

The sixth argument defines the authority/level of the command. It is validated with the newly added player.Authority. So yea, you got yourself an easy admin system in it, just change the player's authority.
Code: [Select]
player.Authority = 5
If the player's authority is equal to more than the command authority, then it is triggered.

The seventh argument defines whether you want to protect the command or validate it to the player's authority. When set to true, it checks whether the player's authority is equal to or more than the command's authority. When set to false, it skips this validation step.

The last argument is Assosicate. It defines whether to get command's  'args' in form of table or array. When set to true, values are received in table form or else in array form.


Once done, you need to bind an environment and a function with 2 parameters (player and arguments) to the command by for example,
Code: [Select]
CMD_Manager.Create().BindExec(this, function (player, args) {

});



Lets create a command sethealth
Code: [Select]
CMD_Manager.Create("sethealth", "s|i", ["Target", "HP"], 0, 2, 1, true, false).BindExec(this, function(player, args) {
    if(args.len() >= 2)
    {
        local plr = FindPlayer(args[2]);
        if(plr)
        {
            if(args[1] <= 255 && args[1] >= 0)
            {
                Message(format("%s changed the health of %s to %d", player.Name, plr.Name, args[1]));
                plr.Health = args[1];
            }
            else MessagePlayer("Health must be between 0 to 255.", player);
        }
        else MessagePlayer("Unknown player", player);
    }
    else MessagePlayer("Wrong syntax, use /sethealth <player> <hp>", player)
})
This command is set to work if the arguments passed by the player are in between 0 to 2, having authority 1. Since the Associate is defined as zero, the arguments are in form of an array. Now the same command but which Associate set to true:
Code: [Select]
CMD_Manager.Create("sethealth", "s|i", ["Target", "HP"], 0, 2, 1, true, true).BindExec(this, function(player, args) {
    if(args.rawin("Target") && args.rawin("HP"))
    {
        local plr = FindPlayer(args.Target);
        if(plr)
        {
            if(args[1] <= 255 && args[1] >= 0)
            {
                Message(format("%s changed the health of %s to %d", player.Name, plr.Name, args.HP));
                plr.Health = args.HP;
            }
            else MessagePlayer("Health must be between 0 to 255.", player);
        }
        else MessagePlayer("Unknown player", player);
    }
    else MessagePlayer("Wrong syntax, use /sethealth <player> <hp>", player)
})
The arguments are now in table form.



Error Handling:

In order to trigger errors for the commands, you need to define a BindFail function.

There are total 5 types of Errors defined in an Enum:
Code: [Select]
enum CMDErrorTypes {
    UnknownCommand,
    InsufficientAuth,
    UnsupportedArg,
    IncompleteArgs,
    SyntaxError
}

An example of BindFail function:
Code: [Select]
CMD_Manager.BindFail(this, function (type, player, cmd, msg) {

switch(type)
{
case CMDErrorTypes.UnknownCommand:
MessagePlayer("[#ffffff]Error - Command doesn't exist.", player);
break;
case CMDErrorTypes.InsufficientAuth:
MessagePlayer("[#FF3300]Error - Unauthorized Access.", player);
break;
case CMDErrorTypes.UnsupportedArg:
MessagePlayer(format("[#DDFF33]Error - Wrong type of parameter passed to command %s.", cmd), player);
break;
case CMDErrorTypes.IncompleteArgs:
MessagePlayer(format("[#FFDD33]Error - Incomplete arguments for command %s.", cmd), player);
break;
case CMDErrorTypes.SyntaxError:
MessagePlayer(format("[#ff0000]Error - [#ffffff]Command %s throwed an error: %s", cmd, msg), player);
break;
default:
print("Bind Fail called");
break;
}
})





All credits go to SLC for this post too as I stole some content of his :P





Some cool things that you can do for example:
(click to show/hide)
Code: [Select]
CMD_Manager.Create("cmds", "", [""], 0, 0, 1, true, true).BindExec(this, function (player, args) {
    local msg = "";
    foreach(listener in CMD_Manager.GetArray())
    {
        {
            if(msg != "") msg += ", ";
            msg += listener.Name;
        }
    }
    MessagePlayer(format("Available commands: %s", msg), player);
});

An example of having commands with the same function but different name (like wep, we)


Code: [Select]
{
    local exec = function (player, args) {
       if(args.rawin("code"))
    {
        try
        {
            local cscr = compilestring(args.code);
            cscr();
        }
        catch (e) MessagePlayer(format("Exection Error %s", e), player);
    }
    else MessagePlayer("/e ( Code )", player);
    }
    CMD_Manager.Create("e", "g", ["code"], 0, 1, 1, true, true).BindExec(this, exec);
    CMD_Manager.Create("exec", "g", ["code"], 0, 1, 1, true, true).BindExec(this, exec);
}
6
Community Plugins / Re: New scripting language support: Java
« on January 13th, 08:50 AM by rishabs »

Great! this is helpful, thanks for sharing.
7
Quote from Gulk on December 23rd, 2021, 09:11 PM
http://u04.vc-mp.org

Thats the official up to date updater link.
Error at Client Launch: Failed to check update list. HTTP error encountered. (404)

Tried the Update URL:  http://u04.thijn.ovh and somehow it downloaded once a Update and after that some things are broken now just like Checkpoints Alpha is not set and also MapIcon's Alpha is not set anymore and sometimes a crash Message appears when a Checkpoint is visible.
Anyone else got the Error with the official Update URL?
8
Support / need a little help
« on January 10th, 01:15 PM by IdleOne »
hey all,

came back to vcmp after a bit and im getting a version conflict error when I try to join littlewhitey's.

Ive downloaded the 04rel006 files but its still not happy.

any help is appreciated.

cheers.
9
Yeah same happening to me, other servers are running perfectly fine to me. Is it any possible fix for that if there is please take us to that.
10
General Discussion / Re: Magna 2021 - VCAD
« on January 8th, 09:55 AM by Siezer55 »
After a long break, our staff team is all set to host their first match. Two strong teams are rubbing their shoulders today at 17 GMT. Hope you are as excited as us. We’ll live stream the match, stay tuned.