coords
#5

did you test that? cause my logic is screaming no at me.
this is what i would do to your code
pawn Код:
#include <zcmd>

cmd(forward, playerid, params[])
{
  if (isnull(params)) return SendClientMessage(playerid, 0xafafafff, "Usage: /forward [units]"); //okay, i am going to let this slide

  new
    Float:x,
    Float:y,
    Float:z,
    Float:angle;

  GetPlayerPos(playerid, x, y, z);
  GetPlayerFacingAngle(playerid, angle);
  x = x + strval(params) * floatsin( -angle, degrees ); //you don't pass floats by doing Float:angle, so no need to put it before the degrees
  y = y + strval(params) * floatcos(-angle, degrees); //y is sin x is cos, cause if angle is 90.0 then the cos of that is 0.0 wich means if angle is south, x does not need to changed
  SetPlayerPosFindZ(playerid, x, y, z); //kudo's for using findz to make sure they don't fall through the ground.
  return 1;
}
Reply


Messages In This Thread
coords - by Lajko1 - 06.11.2009, 07:58
Re: coords - by Finn - 06.11.2009, 08:02
Re: coords - by Zeromanster - 06.11.2009, 09:09
Re: coords - by Donny_k - 06.11.2009, 09:41
Re: coords - by Daren_Jacobson - 06.11.2009, 13:35
Re: coords - by Lajko1 - 06.11.2009, 14:04
Re: coords - by Daren_Jacobson - 06.11.2009, 14:09
Re: coords - by Lajko1 - 06.11.2009, 15:39
Re: coords - by member - 06.11.2009, 15:48
Re: coords - by Donny_k - 06.11.2009, 16:13

Forum Jump:


Users browsing this thread: 1 Guest(s)