detachobject
#1

I've created a object editor with AttachObjectToPlayer, now what i want is detach it.. i've created the following to Destroy the object, and then place it again to detach it. But someway or another, it doesn't show up. Does anybody know why?

This is my code:

pawn Код:
new Float:X, Float:Y, Float:Z;
GetObjectPos(Object[playerid], X, Y, Z);
DestroyObject(Object[playerid]);
CreateObject(Object[playerid], X, Y, Z, 0, 0, 0);
Thnx
Reply
#2

I did that, but still no result, can you see whats wrong?

Heres both codes:

pawn Код:
new Object[MAX_PLAYERS];
pawn Код:
dcmd_obj(playerid,params[])
{
    new Float:X, Float:Y, Float:Z, Float:Angle;
    GetPlayerPos(playerid, X, Y, Z);
    Object[playerid] = CreateObject(1655, X, Y, Z, 0, 0, 0);
  AttachObjectToPlayer(Object[playerid] ,playerid, 0, 8, 0, 0, 0, 0);
    return 1;
}
pawn Код:
dcmd_can(playerid,params[])
{
    new Float:X, Float:Y, Float:Z;
    GetObjectPos(Object[playerid], X, Y, Z);
    DestroyObject(Object[playerid]);
    CreateObject(Object[playerid], X, Y, Z, 0, 0, 0);
    return 1;
}
>< Thnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)