06.11.2009, 13:35
did you test that? cause my logic is screaming no at me.
this is what i would do to your code
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;
}

