31.10.2010, 01:24
Hey guys,
I'm currently working on a new trunk saving system. Anyhow, here's a little bit of my code which detects whether the player is in a 3.5 radius of the vehicle and if the vehicle is an ownable car which then stores it in an array. Although it's only supposed to do it in a 3.5 radius of ownable cars, it does it globally for every car so when you do /trunk info it shows the trunk for every car.
Anyone got any ideas?
~ Mike.
I'm currently working on a new trunk saving system. Anyhow, here's a little bit of my code which detects whether the player is in a 3.5 radius of the vehicle and if the vehicle is an ownable car which then stores it in an array. Although it's only supposed to do it in a 3.5 radius of ownable cars, it does it globally for every car so when you do /trunk info it shows the trunk for every car.
pawn Код:
for(new i; i != MAX_VEHICLES; i++)
{
new Float:PosX,Float:PosY,Float:PosZ;
GetVehiclePos(i,PosX,PosY,PosZ);
if(IsPlayerInRangeOfPoint(playerid, 3.5, PosX,PosY,PosZ))
{
if(IsAnOwnableCar(i))
{
result = i;
}
}
}
~ Mike.