Alright, here's what I did for my vehicle upgrading system way back when (a few years ago).
It might apply but it's a bit of a weird fix and I'm not sure if it works now but it worked at the time....
The first bit of code generates datablocks for everyone who might enter your server. Note, this only generates 20 datablocks. If you plan on having more, make the for loop run more iterations. (You obviously wont need more than 99 unless you're messing with the player counts)
datablock WheeledVehicleData(RWVehicle0 : JeepVehicle)
{
//--SNIP-- Vehicle datablock members were here but I snipped cause it was huge
};
//Generates 20 datablocks that all have different DB names and UI names but everything else is the same
for(%i=1; %i<20; %i++)
{
eval("datablock WheeledVehicleData(RWVehicle" @ %i @ " : RWVehicle0) { uiName = \"RWVehicle" @ %i @ "\"; };");
}
The next part would assign a datablock to someone who joins your server. It takes the first available datablock.
You could then change their specific datablock using $RW::VehicleDatablocks[(%client.RWVehicleDatablock)] member to go in and edit values. For some reason, back when I did this, I never had to transmit datablocks to all the clients. I don't know why I didn't but it worked regardless.
function GameConnection::onClientEnterGame(%this)
{
Parent::onClientEnterGame(%this);
for(%i=0; %i<20; %i++)
{
if(!$RW::VehicleDatablocksAvailable[%i])
{
%this.RW_VehicleDatablock=%i;
$RW::VehicleDatablocks[%i]=true;
return;
}
}
messageClient(%this,"","\c0Error: No vehicle datablock has been assigned to your client as none were available.");
}
This part dumps their datablock back into the pool when they leave.
function gameConnection::onClientLeaveGame(%this)
{
$RW::VehicleDatablocks[(%this.RWVehicleDatablock)]=false;
Parent::onClientLeaveGame(%this);
}
Then, when they wrench a vehicle brick, I made it spawn a vehicle using their datablock and not allowing them to spawn other random vehicles
function wrenchImage::onHitObject(%this, %player, %a, %brick, %particle, %f)
{
%client=%player.client;
if(%brick.getClassName()$="fxDTSBrick" && %brick.dataBlock$="brickVehicleSpawnData")
{
if(%client==%brick.getGroup().client)
{
%vehicle="RWVehicle"@%client.RWVehicleDatablock;
%vehicle=%vehicle.getId();
%brick.setVehicle(%vehicle, %client);
%brick.spawnVehicle();
return;
}
else
{
messageClient(%client,"","Sorry, this isn't your brick");
return;
}
}
Parent::onHitObject(%this, %player, %a, %brick, %particle, %f);
}