13.06.2013, 09:56
(
Last edited by V1ceC1ty; 13/06/2013 at 06:10 PM.
)
Vehicle Gear changes v0.2
Information - This is quite a heavy RP feature you can add to your server which includes 6 Manual Gear changes and speedometer in a Textdraw. It's also great for video editing and NPC making, you can set your vehicle to a lower gear for a smooth ride![ame]http://www.youtube.com/watch?v=9bS59lmXdgw[/ame]
- How to use
• Players can use by default(KEY_YES) to change up a gear and (KEY_NO) to go down a gear.
• RED Coloured gears means you can not change up until it is GREEN
• You must reach the right speed to change to the next gear (#define GEAR1_SPEED 20)
Code:
Default gear speed changes: Engine off -> Gear 1 = 0 Gear 1 -> Gear 2 = 20 Gear 2 -> Gear 3 = 40 Gear 3 -> Gear 4 = 60 Gear 4 -> Gear 5 = 75 Gear 5 -> Gear 6 = 95
• You can turn the engine off when you shift down past Gear 1 or on if you go into Gear 1
• Lower gears have lower speeds, in order to reach the vehicles top speed you must be in Gear 6.
• Players can drive slower wherever they want instead of tapping 'W', just put the car into the desired gear.
• Optional more hardcore gear control. Set to "true" to enable damage if your vehicles RPM is too high for the gear.
Installation -
• Upload vGears.amx to your server 'filterscripts' folder.
• Add 'vGears' to your server.cfg filterscripts line
Known/possible bugs -
• When you enter a vehicle for the first time, gears might not have an effect. To fix Press Y and then N.
This is because the engine might not be turning off correctly.
• Please report more if you can!
Updates -
Update v0.2:
•You now have the option to set gear damage. Having this on will damage the vehicle if they have the RPM too high. By default it is on "false" so set it to "true" if you would like this.
Code:
new bool:DefaultGearDamage = false;
Code:
#define DAMAGE_COUNT 10
If you would like to remove this until I come up with an affective way of properly doing this you can remove the following at lines 421-426:
Code:
if(vGear[playerid] >= 2 && GetPlayerSpeed(playerid) == 0) { vGear[playerid] = 1; SetPlayerSpeedCap(playerid, 0.1); TextDrawSetString(Gear[playerid], "~r~1"); }
v0.2 DIRECT DOWNLOAD
v0.2 PASTEBIN
v0.1 DIRECT DOWNLOAD
v0.1 PASTEBIN
Credits -
Speed limiter provided by Slice
https://sampforum.blast.hk/showthread.php?tid=179089
NOTE: If anyone has a good Race server and is going to use it I'd be really interested in trying it out with a few other players!