Recent posts

#1
Community Plugins / Re: Discord Plugin
Last post by gamingpro - Today at 02:21 AM
Quote from: Samir_HG on Aug 04, 2022, 05:13 PMI'm having this problem when trying to connect:
[2022-08-04 21:56:45] [connect] Successful connection
[2022-08-04 21:56:45] [error] handle_transport_init received error: TLS handshake failed
[2022-08-04 21:56:45] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect
[2022-08-04 21:56:45] [connect] Successful connection
[2022-08-04 21:56:45] [error] handle_transport_init received error: TLS handshake failed
[2022-08-04 21:56:45] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect

Plugin versions used: x32 and x86
Systems used: Windows 10 Pro 21H2 and Ubuntu 20.04 (both updated)
OpenSSL downloaded from https://slproweb.com/products/Win32OpenSSL.html
Tried all versions available on the website.

On Linux, I downloaded libssl-dev as instructed in this tutorial.

I'm using the exact same script that worked months ago.
As a precaution, I decided to create a new one with only the most basic functions as suggested in more recent tutorials and also the examples on GitHub pages.

Two different ISPs were used in the connection attempt. In all the above scenarios returns the same error.
#2
Bugs and Crashes / Re: vcmp client problem with r...
Last post by EazyVU - Apr 30, 2024, 05:31 PM
there's no administartive on this file
#3
Bugs and Crashes / Re: vcmp client problem with r...
Last post by habi2 - Apr 29, 2024, 10:42 PM
Run as administrator.
#4
Bugs and Crashes / vcmp client problem with rocks...
Last post by EazyVU - Apr 29, 2024, 07:06 PM
Some solution?
#5
i did that but not success too, that sometimes get server name Unknown Server
#6
Script Showroom / Script Automatically Fixes Sys...
Last post by PSL - Apr 19, 2024, 08:52 AM
When your script goes wrong, the system finds the wrong code, deletes it, and then restarts the server.
function ReloadServer()
{
    local loaded=[];
    for(local i=0;i<100;i++)
    {
        local plr=FindPlayer(i);
        if(plr)
        {
            loaded.append(plr.ID);
            if(plr.Vehicle) plr.Eject();

            onPlayerPart(plr,0);
        }
    }

    onScriptUnload();
    onServerStop();
    dofile("scripts/main.nut");
    onScriptLoad();
    onServerStart();

    for(local i=0;i<loaded.len();i++)
    {
        local plr=FindPlayer(loaded[i]);
        if(plr)
        {
            onPlayerJoin(plr);
            onPlayerRequestClass(plr,plr.Class,plr.Team,plr.Skin);
            if(plr.IsSpawned==true) onPlayerSpawn(plr);
        }
    }
    AnnounceAll("~p~Server Reload!",3);
}

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;
}

function WriteTextToFile(path,text)
{
    local f=file(path,"wb+"),s="";
    f.seek(0,'e');
    foreach(c in text) f.writen(c,'b');
    f.close();
}

function errorfixer(str)
{
local stackinfo,stacktrace="[Error]\n"+str+"\n[Functions]",locals="\n[Locals]",linearr=[];
for(local i=2;stackinfo=getstackinfos(i);i++)
{
stacktrace+="\n["+stackinfo["func"]+"()] "+stackinfo["src"]+" ["+stackinfo["line"]+"]";
linearr.append(stackinfo["line"].tointeger());
foreach(idx,val in stackinfo["locals"]) locals+="\n["+stackinfo["func"]+"]"+idx+", Value="+val+"";
}
print(stacktrace+locals);

    local script=ReadTextFromFile("scripts/main.nut");
    local arr=split(script,"\n"),data="";
    for(local i=1;i<arr.len()+1;i++)
    {
        local find=false;
        for(local ii=0;ii<linearr.len();ii++)
        {
            if(i==linearr[ii].tointeger())
            {
                find=true;
                break;
            }     
            if(find==false)
            {
                data+=arr[i-1];
                break;
            }
        }
    }
    WriteTextToFile("scripts/main.nut",data);
    ReloadServer();
}
seterrorhandler(errorfixer);
#7
sorry if I posted in wrong board, I need the script for science
#8
Scripting and Server Management / Re: How to unload scripts?
Last post by PSL - Mar 24, 2024, 02:38 PM
I'm looking into this plugin: https://forum.vc-mp.org/index.php?topic=9181.0
I'll publish the results within 90 days.
#9
Off-Topic General / Asian City Triple Clash - ACTC...
Last post by Broly. - Mar 24, 2024, 08:07 AM
🎉🌟 Attention VCMP Clan Members! You're Invited to the Asian City Triple Clash - ACTC Event! 🌟🎉

How it Works:
Join our AC discord: https://discord.gg/4geCusrX


Gather your team of 3 or 4, including the captain.
Copy and fill out the format in the ⁠team-applications board.
Interested in becoming a referee? Copy and fill out the format in the ⁠referee-applications  board.
Each team can have 4 players (including the captain), with 3 players playing and 1 player as a sub.


Prizes:
Winning Team:15USD Dollars, $2M, a Hydra, and a Ferrari vehicle.

Runner-up Team: $1M and an Infernus Vehicle.

Match Hosting:
Format: 3 vs 3.
Limited weapons during matches.
Each match consists of 3 rounds, each lasting 15 minutes.
Scoring: Each kill earns 1 point, while spree will give you +3 score.

Server IP : 162.19.27.237:8192

Last Date to Apply : 27/03/2024
For more Info you can Check

ACTC-information


#10
Script Showroom / Re: BindKey Process System
Last post by PSL - Mar 24, 2024, 12:45 AM
I updated the function to set the number of repetitions, Make adding code easier.
AddKeyToTable(Key_K,10); //When K is pressed, it is automatically executed 10 times.
Create nut to scripts folder gift, name is keyprocess.nut.

//by: https://forum.vc-mp.org/index.php?topic=9397.0
//Function
/*
AddKeyToTable(key); //Set a key to repeat
AddKeyToTable(key,processtimes); //Set the key to repeat and set the number of repetitions
DeleteKeyToTable(key); //Delete the duplicate function of the key
SetKeyExecTime(time); //Set the interval for automatic execution
*/

function LoadKeyProcess()
{
ProcessKey<-{}; //Records repeatable keys
ProcessKeyTime<-10; //Execution interval milliseconds
ProcessKeyTimer<-null; //Execute key timer

PlayerKeys<-{}; //Record the keys pressed by the player

ProcessKeyExecTimes<-{}; //Records the number of key executions
PlayerKeyExecTimes<-array(100,null); //Record the number of times a player executes each key
}

function AddKeyToTable(key,processtimes=null)
{
ProcessKey.rawset(key,key);
if(processtimes!=null) ProcessKeyExecTimes.rawset(key,processtimes);
}

function DeleteKeyToTable(key)
{
if(ProcessKey.rawin(key)) ProcessKey.rawdelete(key);
if(ProcessKeyExecTimes.rawin(key)) ProcessKeyExecTimes.rawdelete(key);
}

function SetKeyExecTime(times)
{
if(times<0) times=1;
ProcessKeyTime=times;
}

function AddPlayerKeyToTable(i,key)
{
local plr=FindPlayer(i);
if(plr)
{
if(ProcessKey.rawin(key))
{
if(PlayerKeys.rawin(plr.ID))
{
local arr=PlayerKeys.rawget(plr.ID),find=false;
for(i=0;i<arr.len();i++)
{
if(arr[i]==key)
{
find=true;
break;
}
}
if(find==false) arr.append(key);
}
else
{
local arr=[];
arr.append(key);
PlayerKeys.rawset(plr.ID,arr);
}

if(ProcessKeyExecTimes.rawin(key))
{
if(PlayerKeyExecTimes[plr.ID]==null) PlayerKeyExecTimes[plr.ID]={};
if(PlayerKeyExecTimes[plr.ID].rawin(key))
{
local times=PlayerKeyExecTimes[plr.ID].rawget(key);
times-=1;
PlayerKeyExecTimes[plr.ID].rawset(key,times);
}
else
{
local keytimes=ProcessKeyExecTimes.rawget(key);
PlayerKeyExecTimes[plr.ID].rawset(key,keytimes);
}
}
CreateProcessKeyTimer();
}
}
}

function DeletePlayerKeyToTable(i,key)
{
local plr=FindPlayer(i);
if(plr)
{
if(ProcessKey.rawin(key))
{
if(PlayerKeys.rawin(plr.ID))
{
local arr=PlayerKeys.rawget(plr.ID);
for(local i=0;i<arr.len();i++)
{
if(arr[i]==key)
{
arr.remove(i);
break;
}
}
if(arr.len()==0) PlayerKeys.rawdelete(plr.ID);
}
if(ProcessKeyExecTimes.rawin(key))
{
if(PlayerKeyExecTimes[plr.ID]!=null)
{
if(PlayerKeyExecTimes[plr.ID].rawin(key))
{
PlayerKeyExecTimes[plr.ID].rawdelete(key);
if(PlayerKeyExecTimes[plr.ID].len()==0) PlayerKeyExecTimes[plr.ID]=null;
}
}
}
if(PlayerKeys.len()==0) DeleteProcessKeyTimer();
}
}
}

function DeleteAllPlayerKeyToTable(i)
{
local plr=FindPlayer(i);
if(plr)
{
if(PlayerKeys.rawin(plr.ID)) PlayerKeys.rawdelete(plr.ID);
if(PlayerKeyExecTimes[plr.ID]!=null) PlayerKeyExecTimes[plr.ID]=null;
}
}

function CreateProcessKeyTimer()
{
if(ProcessKeyTimer==null) ProcessKeyTimer=NewTimer("onServerKeyProcess",ProcessKeyTime,0);
}

function DeleteProcessKeyTimer()
{
if(ProcessKeyTimer!=null) ProcessKeyTimer.Delete();
ProcessKeyTimer=null;
}

function onServerKeyProcess()
{
for(local i=0;i<100;i++)
{
local plr=FindPlayer(i);
if(plr)
{
if(PlayerKeys.rawin(plr.ID))
{
local arr=PlayerKeys.rawget(plr.ID);
for(local i=0;i<arr.len();i++)
{
local find=false;
if(ProcessKeyExecTimes.rawin(arr[i]))
{
if(PlayerKeyExecTimes[plr.ID]!=null)
{
if(PlayerKeyExecTimes[plr.ID].rawin(arr[i]))
{
local keytimes=PlayerKeyExecTimes[plr.ID].rawget(arr[i]);
if(keytimes<0) find=true;
}
}
}
if(find==false) onKeyDown(plr,arr[i]);
}
}
}
}
}

LoadKeyProcess();

Add in main.nut
function onScriptLoad()
{
dofile("scripts/keyprocess.nut");
}
function onPlayerPart(player,reason)
{
DeleteAllPlayerKeyToTable(player.ID);
}
function onKeyDown(player,key)
{
AddPlayerKeyToTable(player.ID,key);
}
function onKeyUp(player,key)
{
DeletePlayerKeyToTable(player.ID,key);
}

Very simple way to add. You can customize the key Settings according to the previous code.