wheel Trigometry
#1

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

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(playeridPPos[0], PPos[1], PPos[2]);
  
GetVehiclePos(LastVehicle[playerid], LVPos[0], LVPos[1], LVPos[2]);
  
GetVehicleZAngle(vehicleidLVA[0]);
  
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
  
GetVehicleModelInfo(420VEHICLE_MODEL_INFO_WHEELSFRONTOffset[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(playerid5LVPos[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(playeridLVPos[0] += Offset[0]-2.4LVPos[1] += Offset[1]-0.4LVPos[2] += Offset[2]-0.41.0);
       }
    }
  }
  return 
1;

Reply


Messages In This Thread
wheel Trigometry - by Pillhead2007 - 01.08.2014, 17:57
Re: wheel Trigometry - by Threshold - 02.08.2014, 00:19
Re: wheel Trigometry - by Threshold - 02.08.2014, 06:25
Re: wheel Trigometry - by Pillhead2007 - 02.08.2014, 09:19

Forum Jump:


Users browsing this thread: 2 Guest(s)