01.08.2014, 17:57
hey guys
im trying to make a script that basically if your tires are defliated you get a tire out the boot and it will seta player maker to which detected tire burst
but the trigometry is wrong cause it doesn't detect the angle of the vehicle here is my code
im trying to make a script that basically if your tires are defliated you get a tire out the boot and it will seta player maker to which detected tire burst
but the trigometry is wrong cause it doesn't detect the angle of the vehicle here is my code
PHP код:
public OnPlayerUpdate(playerid)
{
//new string[128];
new Float:PPos[3];
new Float:Offset[6];
new Float:LVPos[6], Float:LVA[1];
new panels,doors,lights,tires;
new vehicleid = LastVehicle[playerid];
GetPlayerPos(playerid, PPos[0], PPos[1], PPos[2]);
GetVehiclePos(LastVehicle[playerid], LVPos[0], LVPos[1], LVPos[2]);
GetVehicleZAngle(vehicleid, LVA[0]);
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
GetVehicleModelInfo(420, VEHICLE_MODEL_INFO_WHEELSFRONT, Offset[0], Offset[1], Offset[2]);
//format(string, sizeof(string), "X:%0.f, Y:%0.f, Z:%0.f, A:%0.f", LVPos[0], LVPos[1], LVPos[2], LVA[0]);
//SendClientMessage(playerid, -1, string);
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && tires == 15)
{
if(IsPlayerInRangeOfPoint(playerid, 5, LVPos[0], LVPos[1], LVPos[2]))
{
if(LVA[0] >= Offset[0]-2.4)
{
//if(LVPos[0] >= Offset[0]-2.4 && LVPos[0] <= Offset[0] && LVPos[1] >= Offset[1]-0.4 && LVPos[1]<= Offset[1]+0.4 && LVPos[2] >= Offset[2]-0.4 && LVPos[2] <= Offset[2]+0.4)
//{
SetPlayerCheckpoint(playerid, LVPos[0] += Offset[0]-2.4, LVPos[1] += Offset[1]-0.4, LVPos[2] += Offset[2]-0.4, 1.0);
}
}
}
return 1;
}