
05.06.2022, 18:56
|
|
Познавший АНТИЧАТ
Регистрация: 29.03.2021
Сообщений: 1,092
С нами:
2698985
Репутация:
88
|
|
Сообщение от horacy
Как проверить, занято ли транспортное средство?
Lua:
Код:
local
res
,
handle
=
sampGetCarHandleBySampVehicleId
(
i
)
if
res
then
if
getDriverOfCar
(
handle
)
==
-
1
then
-- code
end
end
C++:
Код:
CVehicle
*
handle
=
reinterpret_cast
(
SF
->
getSAMP
(
)
->
getVehicles
(
)
->
GetCarHandleFromSAMPCarID
(
vehID
)
)
;
if
(
!
handle
)
return
;
if
(
handle
->
GetDriver
(
)
)
{
// занято
}
else
{
// свободно
}
|
|
|