Samp command help
#4

pawn Код:
stock IsPlayerNearAnyTrunk(playerid)
{
 for(new vehicleid= 0; vehicleid < MAX_VEHICLES; vehicleid++)
 {
  if(GetVehicleModel(vehicleid) == 0) continue;

  new Float:x, Float:y, Float:z;
  GetVehicleTrunkPosition(vehicleid, x, y, z);
  if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
  {
   return vehicleid;
  }
 }
 return -1;
}

GetVehicleTrunkPosition(vehicleid, &Float:x, &Float:y, &Float:z)
{
    new Float:a, Float:z, Float:xo, Float:yo, Float:zo;
    GetVehiclePos(vehicleid, x, y, z);
    GetVehicleZAngle(vehicleid, a);
    GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, xo, yo, zo);

    x += (-yo* floatsin(-a, degrees));
    y += (-yo* floatcos(-a, degrees));
}
Reply


Messages In This Thread
Samp command help - by San1 - 22.06.2013, 17:44
Re: Samp command help - by IstuntmanI - 22.06.2013, 17:59
Re: Samp command help - by CountyRP - 22.06.2013, 18:00
Re: Samp command help - by RedFusion - 22.06.2013, 18:12

Forum Jump:


Users browsing this thread: 1 Guest(s)