vehicle time

Started by Kewun, May 05, 2016, 03:32 PM

Previous topic - Next topic

Thijn

Do you actually call that function anywhere?

jayant

Quote from: jayant on May 05, 2016, 07:06 PMExamples are untested.
@Kewun  I was just trying to explain usage of loops.

KAKAN

Quote from: Thijn on May 06, 2016, 06:25 AMDo you actually call that function anywhere?
Thijn, you didn't get him, from his last post, I get to know that, he wants to slow down the respawn time when a vehicle gets destroyed.
Aka: When the vehicles gets destroyed, it respawns automagically, he wants to control it via his script. The only method I can think of is to remove the vehicle and add it again later using timers
oh no

Milos

Quote from: jayant on May 05, 2016, 07:06 PM/*With for loop*/
Syntax:

for(declare & intialise variable;condition;increment/decrement)
{
 //Statements to execute
}

for( local i=130; i <= GetVehicleCount(); i++ )
        {
        local veh = FindVehicle( i );
        if(veh)
       {
       veh.RespawnTimer = 10000;
        }
       }

/*While loop*/

Syntax:

Declare and initialise variable;
while(condition)/*Entry controlled loop*/
{
 //Statements to execute
}

So,

local i = 130;
while(i<=GetVehicleCount)
{
 local veh = FindVehicle(i);
 if(veh)
 {
 veh.RespawnTimer = 1000;
}
i++;
}

/*Do while loop*/
Syntax:

do
{
 //Statements to execute
i++;
}while(condtion);
So, you can do the same in do-while loop.
Examples are untested.
These loops does not configure all vehicles
I think you are confusing ID and Model

jayant


Thijn

Quote from: KAKAN on May 06, 2016, 08:18 AM
Quote from: Thijn on May 06, 2016, 06:25 AMDo you actually call that function anywhere?
Thijn, you didn't get him, from his last post, I get to know that, he wants to slow down the respawn time when a vehicle gets destroyed.
Aka: When the vehicles gets destroyed, it respawns automagically, he wants to control it via his script. The only method I can think of is to remove the vehicle and add it again later using timers
That's exactly what Vehicle.RespawnTime is for. And that code snippet should work by the looks of it.

Mötley

So there is no need to remove cars xml side and script them in server side to take full control? just curious @Thijn ,. This is one nice thing to do at least in [LU]. I have not tried in [VC:MP] yet

 :P(allows entire full control over vehicles regardless of anything what so ever. I find that the cars in xml have there own setting that scripting nature could not fully control at times, it just helps..)

Thijn

Quote from: Mötley on May 06, 2016, 03:38 PMSo there is no need to remove cars xml side and script them in server side to take full control? just curious @Thijn ,. This is one nice thing to do at least in [LU]. I have not tried in [VC:MP] yet

 :P(allows entire full control over vehicles regardless of anything what so ever. I find that the cars in xml have there own setting that scripting nature could not fully control at times, it just helps..)
Your post made no sense to me. Care to elaborate?

Mötley

#23
I will try (on my phone/away from pc)

I will explain LU wise as I can explain more accurate.

So basically a lot of times when cars are spawned into the world from the server xml, the xml will overwrite respawn time as well as keeping the exact amount of damage as I have seen these cars overwrite scripting features.

When using ::CreateVehicle (I believe that is what it is) I can fully do anything I want to cars keeping the exact amount of damage to a vehicle for say 10 days of the server running, as well as keeping cars where they were last used, but sometimes cars would become bugged and it's impossible to enter a car by the 4th day.

I found that the xml overwrites features a lot of times.

So I am curious if his script is not incorrect..
 :P unless someone can verify

@Thijn 

Okay so I ran some test finnaly and removed the vehicles from the xml to server side and added the cars with CreateVehicle
What happens with
Vehicle.RespawnTimeris that it will respawn the vehicle over and over again. Basically if not used and you change the time of the created vehicle to say 100 it will keep creating the vehicle causing 99.9 percent bad data usage,
What is needed is a delay not a respawn.timer.

Maybe with the code
FindVehiclefollowing [player.ID]
And add Vehicle.Remove somewhere where that would be valid without the players vehicle disapering pis*ing off the player base.

This should cause the vehicle to not get recreated if I am correct. then the vehicle should create on that next long re-spawn timer of
Vehicle.RespawnTimer
as the vehicle does need to be removed from the server and with server side scripting the vehicle can be re created at another time.

If you could shoot me a way that's valid
on Vehicle.Remove without the players vehicle disappearing pis*ing off the player base.
I will most definitely do that. and respond with my answer.