Attach Object To Vehicle ( I can pay for help : PM me )
#2

One more person that confused on attachobject functions, i have to say again that:
SetPlayerAttachedObject functions are SEPARATED from CreateObject/CreatePlayerObject pools
That's mean, it's different type of object, so you can't use the same function. You can't use AttachObjectToVehicle with object set from SetPlayerAttachedObject, SetPlayerAttachedObject are "attached object on player character/skin" previously know as Holding Object or also known as Clothes, CreateObject are global objects created for the world map (san andreas).

Global objects = global and visible to anything, id is returned with CreateObject (you can't set id number)
Player objects = like global objects, but only visible to the player, id is returned with CreatePlayerObject (you can't set id number)
Attached Object = attached on player skin, visible to every streamed in player, does not have id, but uses 10 slots numbered from 0 to 9, it is non solid and the scale can be changed, always attached on the skin bone (e.g. on head, so if the players rotate their head, then the attached object will follow).

Functions:
DescriptionObjectPlayer ObjectAttached Object
Create withCreateObjectCreatePlayerObject-
Set with--SetPlayerAttachedObject
Destroy withDestroyObjectDestroyPlayerObject-
Remove with--RemovePlayerAttachedObject
Select with (cursor)SelectObjectSelectObject-
Check if valid withIsValidObjectIsValidPlayerObjectIsPlayerAttachedObjectSlotUsed
Edit withEditObjectEditPlayerObjectEditAttachedObject
Set pos withSetObjectPosSetPlayerObjectPosSetPlayerAttachedObject
Set rot withSetObjectRotSetPlayerObjectRotSetPlayerAttachedObject
Set material withSetObjectMaterialSetPlayerObjectMaterialSetPlayerAttachedObject (only color at index 0 and 1)
Set material text withSetObjectMaterialTextSetPlayerObjectMaterialText-
Move withMoveObjectMovePlayerObject-
Attach to object withAttachObjectToObject--
Attach to player withAttachObjectToPlayerAttachPlayerObjectToPlayerSetPlayerAttachedObject
Attach to vehicle withAttachObjectToVehicleAttachPlayerObjectToVehicle-
Attach camera withAttachCameraToObjectAttachCameraToPlayerObject-
Callbacks:
ObjectPlayer ObjectAttached Object
OnObjectMovedOnPlayerObjectMoved-
OnPlayerEditObjectOnPlayerEditObjectOnPlayerEditAttachedObject
OnPlayerSelectObjectOnPlayerSelectObject-
So i don't know how to help you to solve this problem as you are using wrong functions.
Therefore, this code:
Код:
SetPlayerAttachedObject(playerid, index, PlayerInfo[playerid][pCToyModel][index], bone, Float:PlayerInfo[playerid][pCToyX][index], Float:PlayerInfo[playerid][pCToyY][index], Float:PlayerInfo[playerid][pCToyZ][index], Float:PlayerInfo[playerid][pCToyRX][index], Float:PlayerInfo[playerid][pToyRY][index], Float:PlayerInfo[playerid][pCToyRZ][index], Float:PlayerInfo[playerid][pCToySX][index], Float:PlayerInfo[playerid][pCToySY][index], Float:PlayerInfo[playerid][pCToySZ][index]);
	        new vehicle;
			vehicle = GetPlayerVehicleID(playerid);
			
			AttachPlayerObjectToVehicle(playerid, PlayerInfo[playerid][pCToyModel][index], vehicle, Float:PlayerInfo[playerid][pToyX][index], Float:PlayerInfo[playerid][pToyY][index], Float:PlayerInfo[playerid][pToyZ][index], Float:PlayerInfo[playerid][pToyRX][index], Float:PlayerInfo[playerid][pToyRY][index], Float:PlayerInfo[playerid][pToyRZ][index]);
Means you are trying to attach a object model ID as stored in pCToyModel at index number 0 to 2 on the playerid.
But you are trying to attach a PLAYER OBJECT (which is not made yet) to a vehicle with the attached object SLOT (not id returned by CreatePlayerObject) which is number 0 to 2.

As you can see in the table above, for instance, you use CreateObject you will use MoveObject instead of MovePlayerObject as this function category/object type is different.
Now if you have understand the functions above, you must correct your functions by using CreatePlayerObject instead of SetPlayerAttachedObject. Therefore you need to change almost all things (variables, callbacks, functions) that you used for the object.

Sorry again because i don't get what you mean with (you better explain more), as it will be really different if i try to help you before the functions are corrected. Hope that helps.
Reply


Messages In This Thread
Attach Object To Vehicle ( I can pay for help : PM me ) - by Mikeydoo - 11.01.2016, 07:13
Re: Attach Object To Vehicle ( I can pay for help : PM me ) - by RoboN1X - 11.01.2016, 08:36
Re: Attach Object To Vehicle ( I can pay for help : PM me ) - by Mikeydoo - 11.01.2016, 14:32
Re: Attach Object To Vehicle ( I can pay for help : PM me ) - by RoboN1X - 12.01.2016, 02:39
Re: Attach Object To Vehicle ( I can pay for help : PM me ) - by PrO.GameR - 12.01.2016, 08:48

Forum Jump:


Users browsing this thread: 1 Guest(s)