Gamestudio Links
Zorro Links
Newest Posts
history data for spy not work ?
by faustf. 06/09/23 20:29
Exact time of previous bar of higher timeframe
by AndrewAMD. 06/09/23 15:50
Enter Long Tomorrow at Open + Offset
by Groundhog. 06/09/23 08:50
server auto shutdown kill trades
by andy_trade. 06/08/23 08:52
New Zorro version 2.56
by phs. 06/07/23 20:16
simple question about if long is open
by faustf. 06/06/23 22:00
How to buy tomorrow at open?
by frutza. 06/06/23 02:26
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (Grant, faustf, AndrewAMD), 960 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Vkvishal, Mishiwaka, frutza, BInnacle, androsa
18945 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
car.c how to add a trailer or wagon? #486237
07/01/22 13:35
07/01/22 13:35
Joined: Nov 2008
Posts: 43
Ice2642 Offline OP
Newbie
Ice2642  Offline OP
Newbie

Joined: Nov 2008
Posts: 43
Hello,

Has anyone there already added a wagon or trailer in the car.c template for him to drag with physics and wheels?
Or know how do this?

Like the image.

[Linked Image]

https://ibb.co/JvSMr7H

I Appreciate any help.

Thank you in advance.


A8 PRO 8.47.1
Re: car.c how to add a trailer or wagon? [Re: Ice2642] #487237
02/16/23 10:10
02/16/23 10:10
Joined: Jun 2008
Posts: 22
Russia\Georgia
VoroneTZ Offline
Newbie
VoroneTZ  Offline
Newbie

Joined: Jun 2008
Posts: 22
Russia\Georgia
I check this with "pXcon_setwheel" example from gamestudio manual, works fine


Code
//create trailer at 370 quants behind the player
ENTITY* car2 = ent_create("truck.mdl",vector(player.x-370,player.y,player.z),NULL);

 // add 2 wheels at 43 quants from center of trailer
ENTITY* tBLwheel = ent_create("buggy_rad1.mdl",vector(car2.x,car2.y+43,car2.z+13),NULL); 
ENTITY* tBRwheel = ent_create("buggy_rad1.mdl",vector(car2.x,car2.y-43,car2.z+13),NULL); 

 //add physx to trailer
pXent_settype(car2,PH_RIGID,PH_BOX);

 //connect trailer to player
pXcon_add ( PH_BALL, player, car2, 1 );

//connect wheels to trailer
pXcon_add ( PH_WHEEL, tBLwheel, car2, 0 ); 
pXcon_add ( PH_WHEEL, tBRwheel, car2, 0 );

Re: car.c how to add a trailer or wagon? [Re: Ice2642] #487441
04/24/23 01:53
04/24/23 01:53
Joined: Apr 2023
Posts: 1
O
oncalabo Offline
Guest
oncalabo  Offline
Guest
O

Joined: Apr 2023
Posts: 1
All things in their being are good for something.Thanks.
virtual phone system service

Re: car.c how to add a trailer or wagon? [Re: VoroneTZ] #487473
05/05/23 18:45
05/05/23 18:45
Joined: Nov 2008
Posts: 43
Ice2642 Offline OP
Newbie
Ice2642  Offline OP
Newbie

Joined: Nov 2008
Posts: 43
Originally Posted by VoroneTZ
I check this with "pXcon_setwheel" example from gamestudio manual, works fine


Code
//create trailer at 370 quants behind the player
ENTITY* car2 = ent_create("truck.mdl",vector(player.x-370,player.y,player.z),NULL);

 // add 2 wheels at 43 quants from center of trailer
ENTITY* tBLwheel = ent_create("buggy_rad1.mdl",vector(car2.x,car2.y+43,car2.z+13),NULL); 
ENTITY* tBRwheel = ent_create("buggy_rad1.mdl",vector(car2.x,car2.y-43,car2.z+13),NULL); 

 //add physx to trailer
pXent_settype(car2,PH_RIGID,PH_BOX);

 //connect trailer to player
pXcon_add ( PH_BALL, player, car2, 1 );

//connect wheels to trailer
pXcon_add ( PH_WHEEL, tBLwheel, car2, 0 ); 
pXcon_add ( PH_WHEEL, tBRwheel, car2, 0 );


Thank you, I will try laugh

Best Regards,


A8 PRO 8.47.1

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1