11.08.2010, 16:36

Vehicle Library allows you to get vehicle speed and transmission. I got the idea from Ryder's Transmission filterscript (actually, it is transmission and speed info in textdraw, but with no callbacks).
Usage
Definitions/states:
Code:
VEH_STATE_DRIVING_FORWARD VEH_STATE_DRIVING_BACKWARDS VEH_STATE_NOT_DRIVING
Code:
USE_KMPH USE_MPH
Callbacks:
Code:
OnVehicleTransmissionChange(vehicleid, newtrans, oldtrans); OnVehicleSpeedChange(vehicleid, newspeed, oldspeed);
Code:
public OnVehicleSpeedChange(vehicleid, newspeed, oldspeed) { if(newspeed >= 200) { for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) { new string[128], pName[MAX_PLAYER_NAME]; GetPlayerName(i, pName, sizeof(pName)); format(string, sizeof(string), "SERVER: %s, you are driving too fast. (%i kmph)", newspeed); SendClientMessage(i, 0xF00000AA, string); } } } } return 1; }
Solidfiles.com