Recent posts

#71
Community Plugins / Re: NPC/Bots implementation in...
Last post by habi2 - Feb 17, 2024, 09:31 AM
Quote from: PSL on Feb 17, 2024, 04:02 AMI found a problem in testing this version. When I hide an NPC's console, the NPC doesn't join the server.
ConnectNPC("[NPC]Jack","npcplayback.nut",false,"127.0.0.1","rpclib z-finder");  //Not Join
ConnectNPC("[NPC]Jack","npcplayback.nut",true,"127.0.0.1","rpclib z-finder");  //Join
This issue has been fixed. It was related to npc creating logfiles. Logfiles can now be found in folder npcscripts/logs whenever ConnectNPC is called with console parameter false.
Also,
QuoteCorrected API version to 1.6
Windows
Linux x64
Linux x86
rel004
Source-1.8-beta-zip
Setup (Installer)

What's New in v1.8 Beta?

From Release Notes on the wiki:

Quote
  • New Recording Type: Introducing PLAYER_RECORDING_TYPE_ALL for StartRecordingPlayerData, eliminating the need to specify whether the player is on foot or in a vehicle.

  • Captured Events: PLAYER_RECORDING_TYPE_ALL now supports capturing various events, including player updates, death, pickup events, checkpoint events, object touch/shot events, player chat, player command, private messages, and ClientScriptData.

  • StartRecordingAllPlayerData: A unified function to start recording on all players, including those who may join later.

  • Server Recording: Similar to StartRecordingAllPlayerData, but produces an hrec file with player join times and corresponding rec files for replay. Connected players act as NPCs, replicating player actions.

  • ConnectMultipleNpcs: Connects multiple NPCs from an hrec file produced by PutServerInRecordingMode.

  • recdir Configuration: Introduce recdir 2 in server.cfg to save playback recordings to npcscripts/recordings, with recdir 1 as the default.

  • Npcs with Strings: Npcs can now be called with strings, allowing for custom actions like "function OnNPCSpawn(){SendChat("I have spawned");}".

  • Logfiles: Each NPC now writes logfiles in the npcscripts folder.

  • New NPC Functions: Various new functions added for use by npcscripts, including Suicide, SetMyHealth, GetMyHealth, LookAtPos, LookAtPlayer, GetMyClass, RequestClassAbs, AmISpawned, GetMySkin, GetMyTeam, GetMyArmour, SendPrivMsg, SetConfig, GetPlayerColor, IsPlaybackRunning, IsPlaybackPaused, IsServerInRecordingMode.

  • Additional npc04relxx Plugin Functions: KickAllNPC, IsPlayerRecording, StartRecordingAllPlayerData, StopRecordingAllPlayerData, PutServerInRecordingMode, StopServerInRecordingMode, IsServerInRecordingMode.

  • Configurable max_npc: Added max_npc in server.cfg, optional and limits the number of NPCs in the server (values: 0 to 100, -1 for any number).

  • Console Notifications: Npcs now print their names in the console upon connection, e.g., "Connected. ID: 03 Name: John".

  • Bug Fixes: Fixed issues with NPC getting kicked, not holding weapons on spawn, and incorrect angles for newly streamed players.

  • Private Messages: NPCs can now send private messages.
#72
I'll try to fix his instructions, see if I can help you. I added the onPlayerPart event to simulate the player quitting.
if (cmd == "reload") {
    local loaded = []
    foreach (v in getOnlinePlayers())
   {
        if (getPlayer(v.ID) != null && getPlayer(v.ID).Spawned)
        {
                 loaded.append(getPlayer(v.ID))
        }
    }
    for(local i=0;i<100;i++)
    {
        local plr=FindPlayer(i);
        if(plr)
        {
            onPlayerPart(plr,1);
        }
    }
    onServerStop();
    dofile("main.nut") // your main script.
    onScriptLoad()
    foreach (b in getOnlinePlayers()) {
        onPlayerJoin(getPlayer(b.ID))
    }
    foreach (plr in loaded) {
        onPlayerRequestClass(plr, plr.Class, plr.Team, plr.Skin)
        if (plr.IsSpawned) onPlayerSpawn(plr)
    }
    AnnounceAll("Reloaded.", 0)
    return 1;
}
#73
Scripting and Server Management / Re: Weapon error call
Last post by PSL - Feb 17, 2024, 06:34 AM
I have cancelled the downgrade of the server version, thank you for your comments and reminders, the custom weapon bug has been fixed in 04rel006 version.
#74
Community Plugins / Re: NPC/Bots implementation in...
Last post by PSL - Feb 17, 2024, 04:02 AM
HI Habi, I tried this version and the vehicle playback speed is almost exactly the same as the original speed, the vehicle playback speed issue has been fixed. Thank you for fixing this little bug. I really appreciate your update.
I found a problem in testing this version. When I hide an NPC's console, the NPC doesn't join the server.
ConnectNPC("[NPC]Jack","npcplayback.nut",false,"127.0.0.1","rpclib z-finder");  //Not Join
ConnectNPC("[NPC]Jack","npcplayback.nut",true,"127.0.0.1","rpclib z-finder");  //Join
#75
Community Plugins / Re: NPC/Bots implementation in...
Last post by habi2 - Feb 16, 2024, 06:24 PM
Hi PSL, can you confirm if this release candidates of v1.8 beta solves the issue of car not accelerating.

windows
linux-x64
linux-86
rel004
source-1.8-beta-zip
setup (installer)

Also thanks for confirming about location of server.

I decreased sleep time between cycles from 30 to 5 ms and found that cars are accelerating without lags. Also the time taken by npc to omplete the race now matches against the original time.
#76
Snippet Showroom / Re: [clientside] 3d line (like...
Last post by Sebastian - Feb 15, 2024, 08:33 PM
Cool! this is something I need.
Thank you!
#77
Scripting and Server Management / Re: Weapon error call
Last post by vitovc - Feb 15, 2024, 04:46 PM
Quote from: Eva on Feb 15, 2024, 04:27 PMStill its a downgrade lol, going back to an earlier release is downgrade not up
yes eva, if we count number of version then its correct. if we count quality of version then its upgrade (as quality, at least by needs of topic starter). for example if you swith your PC from Intel Celeron G6900 to Intel Core i7-8700 it will be 'downgrade' because G6900 is newer but i7-8700 has better perfomance (though 5 years older).
when we play game we need experience not number of version. and vice city itself is 22 years old game... so it all depends of point of view.
#78
Scripting and Server Management / Re: Weapon error call
Last post by Eva - Feb 15, 2024, 04:27 PM
Quote from: vitovc on Feb 14, 2024, 04:57 PM
Quote from: Eva on Feb 14, 2024, 04:13 PMehm thats not upgrade but downgrade, going from 04rel006 to 04rel004.
it depends how to count. 6 is more than 4, rel006 has more value of bugs and limitations and rel004 has less value of bugs and limitations... in rel006 you can not use classsicaxis.asi, widescreen.asi is bugged, you can not push players (it considered as 'bug' by devs), you can not look back by middle mouse button in every angle of player with correct turning head... but  in rel006 you can edit stadium text and turn on taxi lights... do it depends of personal preference.
Still its a downgrade lol, going back to an earlier release is downgrade not up
#79
Script Showroom / Re: Free file upload for scrip...
Last post by Dropgaming - Feb 15, 2024, 12:53 PM
how to create own server in vcmp
#80
Scripting and Server Management / Re: Weapon error call
Last post by PSL - Feb 15, 2024, 04:09 AM
I want the first person shot of 04rel004 because there will be no shaking screen, There are also vehicles that can exceed 1000 HP. I have fixed the bug on the script, but I am still searching for the bug on the custom module.