This script is server sided and I get this error 
 
[2012-05-22 03:17:52] ERROR: realism-system\s_vehicle_crash.lua:11: attempt to call global 'getLocalPlayer' (a nil value) 
 
this is the lua code 
local vehicle = getPedOccupiedVehicle( getLocalPlayer( ) ) 
  
if getVehicleOccupant( vehicle ) == getLocalPlayer( ) and getVehicleType( vehicle ) == "BMX" then 
    if speed then 
        if getElementModel(vehicle) == 510 then --mtbike 
            if speed >= 60 then 
                toggleControl( "accelerate", false ) 
            else 
                toggleControl( "accelerate", true ) 
            end 
        else 
            if speed >= 45 then 
                toggleControl( "accelerate", false ) 
            else 
                toggleControl( "accelerate", true ) 
            end 
        end 
    end 
end