SA-MP Forums Archive
need help cant describe it - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help cant describe it (/showthread.php?tid=121423)



need help cant describe it - braduz - 16.01.2010

is there an playertovehicle
like theres an player to point?


Re: need help cant describe it - [HiC]TheKiller - 16.01.2010

Just edit PlayerToPoint to playertovehicle?


Re: need help cant describe it - braduz - 16.01.2010

Quote:
Originally Posted by [HiC
TheKiller ]
Just edit PlayerToPoint to playertovehicle?
thank you very much but how would i add it?


Re: need help cant describe it - [HiC]TheKiller - 16.01.2010

pawn Код:
VehicleToPoint(Float:radius, VehcileID, Float:X, Float:Y, Float:Z)
{
  new Float:oldpos[3], Float:temppos[3];
  GetVehiclePos(VehcileID, oldpos[0], oldpos[1], oldpos[2]);
  temppos[0] = (oldpos[0] -X);
  temppos[1] = (oldpos[1] -Y);
  temppos[2] = (oldpos[2] -Z);
  if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  {
    return true;
  }
  return false;
}
Or you could just use IsPlayerInRangeOfPoint.


Re: need help cant describe it - braduz - 16.01.2010

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
VehicleToPoint(Float:radius, VehcileID, Float:X, Float:Y, Float:Z)
{
  new Float:oldpos[3], Float:temppos[3];
  GetVehiclePos(VehcileID, oldpos[0], oldpos[1], oldpos[2]);
  temppos[0] = (oldpos[0] -X);
  temppos[1] = (oldpos[1] -Y);
  temppos[2] = (oldpos[2] -Z);
  if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  {
    return true;
  }
  return false;
}
Or you could just use IsPlayerInRangeOfPoint.
shitload of errors
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_PASSENGER)
{
if (GetVehicleModel(vehicleid) == 425)
{
SetPlayerPos(playerid, 2821.106934, -2764.664307, 72.58432;
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
Timer1[playerid] = SetTimerEx("HornA", 60000, 1, "i", playerid);
Timer2[playerid] = SetTimerEx("HornB", 60500, 1, "i", playerid);
IsInAmb[playerid] = vehicleid;
}
}
return 1;
}