Tessék, pár infót még hozzáírtam:
#include
#include
#define OBJECT_DEFAULT_POSITION 0.0,0.0,0.0 //Az object alap pozíciója. (változtasd át)
#define OBJECT_ID 10//Az object id-je.HTTP (változtasd át)
new object;
public OnFilterScriptInit()
{
object = CreateObject(OBJECT_ID,OBJECT_DEFAULT_POSITION,0.0,0.0,0.0);
return 1;
}
CMD:felvesz(playerid)
{
new Float:ox,Float:oy,Float:oz;
GetObjectPos(object,ox,oy,oz);
if(!IsPlayerInRangeOfPoint(playerid,2.0,ox,oy,oz)) return SendClientMessage(playerid,-1,\"Nem vagy az \'object\' közelében!\");
if(GetPVarInt(playerid,\"A_OBJ\") == 1)return SendClientMessage(playerid,-1,\"Már van nálad object.\");
SendClientMessage(playerid,-1,\"Felvetted az \'object\'-et!\");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CARRY);
SetPlayerAttachedObject(playerid, 0, object, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0xFF00FF00);
SetPVarInt(playerid,\"A_OBJ\",1);
//Link: http://forum.sa-mp.com/showthread.php?t=209234
return 1;
}
CMD:letesz(playerid)
{
if(GetPVarInt(playerid,\"A_OBJ\") == 0)return SendClientMessage(playerid,-1,\"Nincs nálad object.\");
new Float:px,Float:py,Float:pz,Float:Angle;
GetPlayerPos(playerid,px,py,pz);
GetPlayerFacingAngle(playerid, Angle);
px += (2 * floatsin(-Angle, degrees));
py += (2 * floatcos(-Angle, degrees));
SetObjectPos(object,px,py,pz-2); //Állítsd majd be a pontos \'pz\' pozíciót.
RemovePlayerAttachedObject(playerid, 0);
SetPVarInt(playerid,\"A_OBJ\",0);
return 1;
}