UnattachObject
#1

Ive seen that after i attached a player an object,
i cant unattach it with "SetPlayerObject".
How can i unattach it other way ?

P.S.: Destroying Object doesnt work, bcause i cannot create an object out of OnGameModeInit
Reply
#2

If it is a playerobject then do DestroyPlayerObject, otherwise DestroyObject.
But there was something changed in 0.3 with the object stuff, read the beta release topic.
Reply
#3

Where to find it ?

btw. i told, destroying doesnt works....
Reply
#4

Quote:
Originally Posted by Trooper[Y
]
Where to find it ?

btw. i told, destroying doesnt works....
destroying works
make a function for it that gets the object post n saves it to some variables,
the it destroys it n creates it back with the positions saved
Reply
#5

attach in car not work...
Reply
#6

im not talking about attaching to a vehicle.

Destroying doesnt worked, as far i cant create a new object.
It just doesnt appear again !
Reply
#7

Quote:
Originally Posted by Trooper[Y
]
im not talking about attaching to a vehicle.

Destroying doesnt worked, as far i cant create a new object.
It just doesnt appear again !
maybe show the script?

erm n i just saw that u said

Quote:
Originally Posted by Trooper[Y
]
P.S.: Destroying Object doesnt work, bcause i cannot create an object out of OnGameModeInit
what do u mean by that?
Reply
#8

If i use "CreateObject" at another point than OnGameModeInit,
nothing happens....

U dont need an script....
I mean, its just a theoretical question, like "how to do it".
Would be enough if you show me an example.

btw. saw in http://forum.sa-mp.com/index.php?topic=119943.0 the reason it didnt worked :
Quote:

If you attach objects to players;
You will need to re-apply the attachment at OnPlayerStreamIn. Example: http://pawn.pastebin.com/f71c9c389, (untested, by lavamike, may work)

Can anybody tell me, how to do this ?
Reply
#9

Quote:
Originally Posted by Trooper[Y
]
If i use "CreateObject" at another point than OnGameModeInit,
nothing happens....

U dont need an script....
I mean, its just a theoretical question, like "how to do it".
Would be enough if you show me an example.

btw. saw in http://forum.sa-mp.com/index.php?topic=119943.0 the reason it didnt worked :
Quote:

If you attach objects to players;
You will need to re-apply the attachment at OnPlayerStreamIn. Example: http://pawn.pastebin.com/f71c9c389, (untested, by lavamike, may work)

Can anybody tell me, how to do this ?
oh didnt see that there a new difference to attaching too X_X
duh this streamin streamout is getting kinda annoying lol
bbut usefull i guess..
only that there are sum functions that need to be changed is kinda annoying n confusing.
Reply
#10

So what do i have to do to unattach it ?!
Reply
#11

Worry more about creating it correctly. I create around 15,000 objects outside of ongamemodeinit with no issue. They all have the correct IDs and I can destroy/recreate them all day long. The fact you can't use CreateObject outside of ongamemodeinit leads me to believe you have bigger issues to worry about.

Once you figure that out, create them with an id and destroy them using that id.
Reply
#12

I tried creating an object and attaching them directly.
The Player didnt got attached anything !
Reply
#13

Quote:
Originally Posted by Trooper[Y
]
I tried creating an object and attaching them directly.
The Player didnt got attached anything !
lol
u need to attach it on ONPlayerStreamIN
i guess but i dunno exactly.
im wondering how to exactly do it too^^
Reply
#14

Quote:
Originally Posted by SaiBerFun
Quote:
Originally Posted by Trooper[Y
]
I tried creating an object and attaching them directly.
The Player didnt got attached anything !
lol
u need to attach it on ONPlayerStreamIN
i guess but i dunno exactly.
im wondering how to exactly do it too^^
i kno now u need to apply it there
like
public OnPlayerStreamIn(playerid, forplayerid)
{
AttachObjectToPlayer(objectid,forplayerid,offX,off Y,offz,iX,iY,iZ);
return 1;
}

then u need a vraiable to check if the forplayer got an object attached
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)