Convoy Trucking

Server related => Suggestions => Locked & Closed Suggestions => Topic started by: Avenger on August 27, 2013, 09:27

Title: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 09:27
Well i actually really want this to be in the server, seeing how trucks have this in real life aswell...
Well it's an engine break slows down the vehicle SLOWLY ...
anyways here it is i will explain


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE))
    {
        if(IsPlayerInAnyVehicle(playerid)) SlowDownVehicle(playerid);
    }
    return 1;
}



stock SlowDownVehicle(playerid)
{
     new Float:vx,Float:vy,Float:vz;
     GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
     SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 0.9, vy *0.9, vz * 0.9);
     return 1;
}


0.8 slowed down the vehicle kinda to fast but 0.9 it just at the spot :D

Well here you have it,
This code has been tested and work really great it took me a while to get it working but i did it :D well i REALLY hope this code will be accepted to the server i would love to use this when going downhill with a truck instead of braking :D plus will make server a little more realistic.

thank you for reading :D

BTW:
if you put ear phones on you can actually hear it slowing down :D
Title: Re: FOR THE SERVER(Engine Break)
Post by: Tyler on August 27, 2013, 09:37
If you'd like this in the server, post it in suggestions.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 09:44
with our without the script?
Title: Re: FOR THE SERVER(Engine Break)
Post by: Tyler on August 27, 2013, 09:49
Quote from: Avenger on August 27, 2013, 09:44
with our without the script?
It doesn't matter.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 09:50
can you move the thread?
i don't wanna make another thread, might be spam...
Title: Re: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 10:17
ok so i have updated the script, apparently that code had a really bad bug on it where when u press accelerate it just stops, so i remade it.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Spekter on August 27, 2013, 11:04
Quote from: Avenger on August 27, 2013, 09:50
can you move the thread?
i don't wanna make another thread, might be spam...


Done.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Ethan on August 27, 2013, 14:36
server already has something similar to this with the damage system... you get your vehicle to 'poor' state with enough damage/wreckless driving and your vehicle will move very slowly... its not needed
Title: Re: FOR THE SERVER(Engine Break)
Post by: Spekter on August 27, 2013, 14:52
Quote from: Ethan on August 27, 2013, 14:36
server already has something similar to this with the damage system... you get your vehicle to 'poor' state with enough damage/wreckless driving and your vehicle will move very slowly... its not needed


Uhm.. i'm pretty sure it was like that in the past, before Mick added the engine stalling if the vehicle is in poor condition. Now there is no speed difference if the vehicle is poor, just the chance of random stalling.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Ethan on August 27, 2013, 14:57
everytime i get a vehicle in less than fair condition I have never gotten up to full speed as if it was perfect
Title: Re: FOR THE SERVER(Engine Break)
Post by: Spekter on August 27, 2013, 15:45
Quote from: Ethan on August 27, 2013, 14:57
everytime i get a vehicle in less than fair condition I have never gotten up to full speed as if it was perfect


Perhaps you should test your theory again.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Rubber on August 27, 2013, 16:49
Quote from: Sveki on August 27, 2013, 15:45
Quote from: Ethan on August 27, 2013, 14:57
everytime i get a vehicle in less than fair condition I have never gotten up to full speed as if it was perfect


Perhaps you should test your theory again.

Sveki is correct. Speed does not decrease with damage. But at poor it has the potential to quit.

On topic: Avenger and I were talking in game and he thought of this. I told him to apply for scripter because he seems like he knows his stuff. He put a lot of time into this unlike most people who suggest things. He even wrote the code for it! Not many suggestions include the script for it. This suggestion is not for the damage system, it is to replicate engine breaking (you know...like on real trucks). Look up some youtube videos if you dont understand the situation. I support this because engine breaking is for cool kids  8)
Title: Re: FOR THE SERVER(Engine Break)
Post by: Ethan on August 27, 2013, 16:50
well i meant this suggestion was similar to the damage system, not anyway related to.. seems interesting at the least
Title: Re: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 19:52
Well as rubber said, yes, but sometime when im going fast downhill and i break and loose control of the truck and have to fail a mission because my trailer falls in the water  :-\ so this would be good to slow down the vehicle, and i would make it so you just click and hold FIRE_KEY but i couldn't get a timer that loops :/
Title: Re: FOR THE SERVER(Engine Break)
Post by: Dobby on August 27, 2013, 19:54
Quote from: Avenger on August 27, 2013, 19:52
Well as rubber said, yes, but sometime when im going fast downhill and i break and loose control of the truck and have to fail a mission because my trailer falls in the water  :-\ so this would be good to slow down the vehicle, and i would make it so you just click and hold FIRE_KEY but i couldn't get a timer that loops :/

Go learn about timers :)

If you're sometimes going fast downhill you should use the break key. Or handbreak and maybe you won't end up going in the water. I mean 70mph? you can't control it?  ::)
Title: Re: FOR THE SERVER(Engine Break)
Post by: Matias on August 27, 2013, 19:57
So, you want us to script and waste a key shortcut just because you suck driving down the hills? No bro, learn to use the brakes first. Convoy Trucking won't waste all the key shortcuts in this kind of stuff which can be easily evaded by pressing spacebar while going downhills.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 20:25
I actually tried to loop from timers but i failed -_-
anyways even with hand break sometimes you hit something which causes you to fly lol...
Title: Re: FOR THE SERVER(Engine Break)
Post by: Matias on August 27, 2013, 20:27
Quote from: Avenger on August 27, 2013, 20:25
I actually tried to loop from timers but i failed -_-
anyways even with hand break sometimes you hit something which causes you to fly lol...

Can i ask you at which downhills are you driving? I dont know any hill that drives you right into water. And if you press handbrake and you fly then remove your mods because they are getting glitched and causing you to fly.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Dobby on August 27, 2013, 20:28
Quote from: Avenger on August 27, 2013, 20:25
I actually tried to loop from timers but i failed -_-
anyways even with hand break sometimes you hit something which causes you to fly lol...

Whats the loop for? :o you just gotta set it to repeating and it should loop no problem each interval.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Avenger on August 27, 2013, 21:01
now that im flying, it's just sometime i click gang break and loose control like right now in the server i flipped because i lost control goin 100 mph-_-
anyways the loop/repeat whatever..
and i don't have any mods...
Title: Re: FOR THE SERVER(Engine Break)
Post by: Hobo on August 27, 2013, 21:09
I don't get it. Do you mean "Engine brake"? Because I don't think you need to script in a break for engines. Just tell people not to drive them for a bit.

Brake for moose or else you'll break your car.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Rubber on August 27, 2013, 21:57
Quote from: Hobo on August 27, 2013, 21:09
I don't get it. Do you mean "Engine brake"? Because I don't think you need to script in a break for engines. Just tell people not to drive them for a bit.

Brake for moose or else you'll break your car.

Engine brake is used to slow down the engine, which slows down the vehicle.
Title: Re: FOR THE SERVER(Engine Break)
Post by: Dobby on August 27, 2013, 22:05
Quote from: Rubber on August 27, 2013, 21:57
Quote from: Hobo on August 27, 2013, 21:09
I don't get it. Do you mean "Engine brake"? Because I don't think you need to script in a break for engines. Just tell people not to drive them for a bit.
Brake for moose or else you'll break your car.
Engine brake is used to slow down the engine, which slows down the vehicle.

Which is what brake and handbrake are for :)
Title: Re: FOR THE SERVER(Engine Break)
Post by: Hobo on August 27, 2013, 22:09
Quote from: Dobby. on August 27, 2013, 22:05
Quote from: Rubber on August 27, 2013, 21:57
Quote from: Hobo on August 27, 2013, 21:09
I don't get it. Do you mean "Engine brake"? Because I don't think you need to script in a break for engines. Just tell people not to drive them for a bit.
Brake for moose or else you'll break your car.
Engine brake is used to slow down the engine, which slows down the vehicle.

Which is what brake and handbrake are for :)
Yes, I'm aware of that but as you can see in the topic title he wrote "Engine BREAK" which makes no sense.

Also, an extra brake is not needed (if that's what you're suggesting).
Title: Re: FOR THE SERVER(Engine Break)
Post by: Dobby on September 03, 2013, 20:31
Quote from: Foose on August 27, 2013, 19:57
So, you want us to script and waste a key shortcut just because you suck driving down the hills? No bro, learn to use the brakes first. Convoy Trucking won't waste all the key shortcuts in this kind of stuff which can be easily evaded by pressing spacebar while going downhills.

This.

+Locked.