[C++] How to check if Player is in Vehicle

Статус
В этой теме нельзя размещать новые ответы.

BlueFire

Новичок
Автор темы
2
0
How do you check if a Player is in a Vehicle?
I have the following;
if(Players->GetInCarData(i)->sVehicleID == 0)
{
//No Vehicle
}
else
{
//Vehicle
}

Unfortunatly, once entered a Vehicle the sVehcileID stays. So if he is once in a Vehicle he is "always" in a vehicle.
Is there another way to check?
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Check your API more detail, maybe it has anything for manipulate on "global" level(structures/classes of MTA, etc.).
If you're have only SAMP structures(it's maybe the RakSAMPClient) then check INCARSYNC_PACKET(or similar)
 

BlueFire

Новичок
Автор темы
2
0
Fixed it. Just manuel reseted it (Players->GetInCarData(i)->sVehicleID = 0;)
Other Problem.
Passenger pos does not seem to get Updated:
Players->GetPassengerData(i)->sVehicleID gives the right vehicle id.
But: Players->GetPassengerData(i)->fPosition are the data from the point he entered the vehicle
any fix to this?
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.