20.02.2014, 14:55
Hey guys!
I've made a fraction-car locking command so a fraction member can lock his fraction-vehicle.
But this only works on the first created fraction vehicle. (fVehicle[0][..])
So here's my command.
If I go to the next vehicle (is also an fraction vehicle, 100%!!) there comes: No car in your range ...
Thank you guys!
I've made a fraction-car locking command so a fraction member can lock his fraction-vehicle.
But this only works on the first created fraction vehicle. (fVehicle[0][..])
So here's my command.
If I go to the next vehicle (is also an fraction vehicle, 100%!!) there comes: No car in your range ...

pawn Код:
CMD:flock(playerid)
{
new Float:pos[3];
if(Player[playerid][pFraction] == 0)return SendClientMessage(playerid, COLOR_LIGHTBLUE, ">> "COLOR_HEX_GREY"You're not in a fraction!");
for(new fV;fV<MAX_FVEHS;fV++)
{
if(IsValidVehicle(fVehicle[fV][vehID]))
{
GetVehiclePos(fVehicle[fV][vehID], pos[0], pos[1], pos[2]);
GetVehicleParamsEx(fVehicle[fV][vehID], engine, lights, alarm, doors, bonnet, boot, objective);
if(IsPlayerInRangeOfPoint(playerid, 3.0, pos[0], pos[1], pos[2]))
{
if(fVehicle[fV][vehFraction] == Player[playerid][pFraction])
{
if(doors == VEHICLE_PARAMS_UNSET || doors == VEHICLE_PARAMS_OFF)
{
LockVehicle(fVehicle[fV][vehID]);
GameTextForPlayer(playerid, "~w~Fracton-Vehicle~n~~r~locked", 3000, 6);
PlaySoundInRange(pos[0], pos[1], pos[2], 1027, 10, 0, 0);
return 1;
}
else if(doors == VEHICLE_PARAMS_ON)
{
UnlockVehicle(fVehicle[fV][vehID]);
GameTextForPlayer(playerid, "~w~Fraction-Vehicle~n~~g~opened", 3000, 6);
PlaySoundInRange(pos[0], pos[1], pos[2], 1027, 10, 0, 0);
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, ">> "COLOR_HEX_GREY"There's no vehicle in your range.");
return 1;
}
}
}
return 1;
}
