Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global SAMP_MAX_VEHICLES := 2000
- global VEHPOOL_iVehicleCount := 0x0
- global VEHPOOL_iIsListed := 0x3074
- global VEHPOOL_pGTA_Vehicle := 0x4FB4
- global iRefreshVeh := 0
- global oVehiclePoolData := ""
- global iUpdateTickVeh := 1000
- getStreamedVehicles() {
- If(!checkHandles())
- return false
- if(iRefreshVeh+iUpdateTickVeh > A_TickCount)
- return 1
- oVehiclePoolData := []
- iRefreshVeh := A_TickCount
- dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
- dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
- stVehiclePool := readDWORD(hGTA, dwAddress + 0x1C)
- vehicleoffset := 0
- Loop, % SAMP_MAX_VEHICLES
- {
- index := A_Index-1, vehicleoffset += 4
- iIsListed := readDWORD(hGTA, stVehiclePool + VEHPOOL_iIsListed + index * 0x4)
- If(iIsListed == 0)
- continue
- ptrGTAVeh := readDWORD(hGTA, stVehiclePool + VEHPOOL_pGTA_Vehicle + index * 0x4)
- If(ptrGTAVeh == 0)
- continue
- dwDriver := readDWORD(hGTA, ptrGTAVeh + 1120)
- occupied := dwDriver != 0 ? 1 : 0
- GTACARid := GetVehicleModelIDByVPed(ptrGTAVeh)
- sVehId := Round(((vehicleoffset / 4) - 1))
- if(GTACARid > 400 && GTACARid < 611)
- oVehiclePoolData[index] := Object("PTR", ptrGTAVeh, "SAMPID", sVehId, "CARNAME", ovehicleNames[GTACARid-399], "OCCUPIED", occupied)
- }
- return 1
- }
- :?:t/test5::
- AddChatMessage("=== Alle gestreamten Fahrzeuge ohne Fahrer: ===")
- GetStreamedVehicles()
- Loop %SAMP_MAX_VEHICLES%
- {
- carID := oVehiclePoolData[A_Index].SAMPID
- name := oVehiclePoolData[A_Index].CARNAME
- occupied := oVehiclePoolData[A_Index].OCCUPIED
- if(!occupied && carID)
- AddChatMessage("ID: " . carID . " Fahrzeugname: " . name)
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement