SHARE
TWEET

Untitled

a guest May 22nd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. multVehicleSpeed(MultValue := 1.01, SleepTime := 10, MaxSpeedX := 2.0, MaxSpeedY := 2.0)
  2. {
  3.     if(multVehicleSpeed_tick + SleepTime > A_TickCount)
  4.         return false
  5.     multVehicleSpeed_tick := A_TickCount
  6.    
  7.     if(!checkHandles())
  8.         return false
  9.     if(!dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR))
  10.         return false
  11.    
  12.     if(!MultValue)
  13.     {
  14.         writeFloat(hGTA, dwAddr + ADDR_VEHICLE_X, 0.0)
  15.         writeFloat(hGTA, dwAddr + ADDR_VEHICLE_Y, 0.0)
  16.         return true
  17.     }
  18.    
  19.     fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
  20.     fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
  21.    
  22.     if(abs(fSpeedX) <= MaxSpeedX)
  23.         writeFloat(hGTA, dwAddr + ADDR_VEHICLE_X, fSpeedX * MultValue)
  24.     if(abs(fSpeedY) <= MaxSpeedY)
  25.         writeFloat(hGTA, dwAddr + ADDR_VEHICLE_Y, fSpeedY * MultValue)
  26.    
  27.     return true
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top