Creating a object infront of you.
#1

The title says it all.
Can someone please show me how to type a command that creates a item infront of you, is there a tutorial for this?

Well, i am going to use it for this /plantbomb script i will make.
Reply
#2

Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	new Float:a;
	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);
	if (GetPlayerVehicleID(playerid)) {
 	GetVehicleZAngle(GetPlayerVehicleID(playerid), a);}
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}
Reply
#3

pawn Код:
CreateObjectInfrontOfPlayer( playerid, modelid, Float:distance = 10.0, Float:rx = 0.0, Float:ry = 0.0 )
{
  new
    Float:x,
    Float:y,
    Float:z;

  if ( GetPlayerPos( playerid, x, y, z ) )
  {
    new
      Float:angle,
      objectid;

    GetPlayerFacingAngle( playerid, angle );
    objectid = CreateObject( modelid, x + ( distance * floatsin( -angle, degrees ) ), y + ( distance * floatsin( -angle, degrees ) ), z, rx, ry, angle );
    return objectid;
  }
  return -1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)