Advertisement
frankdilauro

Untitled

Dec 9th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. global SAMP_MAX_VEHICLES := 2000
  2. global VEHPOOL_iVehicleCount := 0x0
  3. global VEHPOOL_iIsListed := 0x3074
  4. global VEHPOOL_pGTA_Vehicle := 0x4FB4
  5. global iRefreshVeh := 0
  6. global oVehiclePoolData := ""
  7. global iUpdateTickVeh := 1000
  8.  
  9. getStreamedVehicles() {
  10. If(!checkHandles())
  11. return false
  12.  
  13. if(iRefreshVeh+iUpdateTickVeh > A_TickCount)
  14. return 1
  15.  
  16. oVehiclePoolData := []
  17. iRefreshVeh := A_TickCount
  18. dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
  19. dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
  20. stVehiclePool := readDWORD(hGTA, dwAddress + 0x1C)
  21. vehicleoffset := 0
  22.  
  23. Loop, % SAMP_MAX_VEHICLES
  24. {
  25. index := A_Index-1, vehicleoffset += 4
  26. iIsListed := readDWORD(hGTA, stVehiclePool + VEHPOOL_iIsListed + index * 0x4)
  27. If(iIsListed == 0)
  28. continue
  29.  
  30. ptrGTAVeh := readDWORD(hGTA, stVehiclePool + VEHPOOL_pGTA_Vehicle + index * 0x4)
  31. If(ptrGTAVeh == 0)
  32. continue
  33.  
  34. dwDriver := readDWORD(hGTA, ptrGTAVeh + 1120)
  35. occupied := dwDriver != 0 ? 1 : 0
  36.  
  37. GTACARid := GetVehicleModelIDByVPed(ptrGTAVeh)
  38. sVehId := Round(((vehicleoffset / 4) - 1))
  39.  
  40. if(GTACARid > 400 && GTACARid < 611)
  41. oVehiclePoolData[index] := Object("PTR", ptrGTAVeh, "SAMPID", sVehId, "CARNAME", ovehicleNames[GTACARid-399], "OCCUPIED", occupied)
  42. }
  43. return 1
  44. }
  45.  
  46. :?:t/test5::
  47. AddChatMessage("=== Alle gestreamten Fahrzeuge ohne Fahrer: ===")
  48. GetStreamedVehicles()
  49.  
  50. Loop %SAMP_MAX_VEHICLES%
  51. {
  52. carID := oVehiclePoolData[A_Index].SAMPID
  53. name := oVehiclePoolData[A_Index].CARNAME
  54. occupied := oVehiclePoolData[A_Index].OCCUPIED
  55.  
  56. if(!occupied && carID)
  57. AddChatMessage("ID: " . carID . " Fahrzeugname: " . name)
  58. }
  59. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement