SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 20/05/2020, 05:38 AM   #1
Big Clucker
TracerX's Avatar
Join Date: Jun 2014
Location: Poland
Posts: 54
Reputation: 2
Default object-physics include

I was recently trying to work with the Physics include by Peppe, I wanted to create a ball which would be affected by any kind of collision, either it's a vehicle or a player.

Like: Player touches the ball, it would move
Vehicle touches the ball, it would move, is that even possible?

Anyway, thing is, the starters didn't even work out for me. I was testing the include before doing anything and I couldn't get the object to move? when I issue the command, the object gets created and it moves for like 2m then it doesn't move at all again, it wouldn't collide with my player nor a vehicle. What should I do?

My code:

PHP Code:
YCMD:phytest(playeridparams[], help)
#define SPEED (10.0)
    #define Z_SPEED (4.0)
    #define GRAVITY (13.0)
new Float:ppXFloat:ppYFloat:ppZFloat:ppA;
RL_BALL CreateObject(2114ppXppYppZ000100.0);
PHY_SetObjectVelocity(RL_BALLSPEED floatsin(-ppAdegrees), SPEED floatcos(-ppAdegrees), Z_SPEED);
PlayerData[playerid][inPhysics] = true;

TracerX is offline   Reply With Quote
Old 20/05/2020, 10:14 AM   #2
Big Clucker
Join Date: Jun 2013
Location: Trani, Italy
Posts: 89
Reputation: 192
Default Re: object-physics include

Try looking at the soccer gamemode to see how to make interact player and ball

At the moment, it is not straightforward to make vehicle and objects interact, as you would need vehicle collision data and dedicated collision physics
PeppeAC is offline   Reply With Quote
Old 20/05/2020, 10:39 AM   #3
Big Clucker
Join Date: May 2019
Posts: 63
Reputation: 14
Default Re: object-physics include

You need ColAndreas plugin, make sure you initiate the plugin correctly under OnGameModeInit and have the required binary file for it in the scriptfiles folder.
YouShootIDodge is offline   Reply With Quote
Old 20/05/2020, 11:38 AM   #4
Big Clucker
TracerX's Avatar
Join Date: Jun 2014
Location: Poland
Posts: 54
Reputation: 2
Default Re: object-physics include

I have ColAndreas plugin. @Peppe, can you please show me an example of how to make a vehicle interact with an object? I also don't seem to find my problem looking at the soccer gamemode.. @The soccer gamemode, you make the player react with the ball using Keys I assume, I wanted to make the ball automatically react with the vehicle, how am I supposed to that? Or even with the player?
TracerX is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post problem NeamPojma Scripting Help 1 05/06/2018 09:36 AM
Which physics plugin is the best? iWhite Scripting Help 2 07/12/2015 09:47 AM
What is wrong with physics.ini? Metharon Scripting Help 6 10/06/2015 02:40 PM deimantas1 Scripting Help 2 24/09/2013 03:44 PM

All times are GMT. The time now is 01:52 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.