23.12.2015, 16:48
Alright it looks like "PHY_OnObjectCollideWithSAWorld" same for "ColideWithPlayer" doesn't work properly..
I even used them on the ball example you provided
I even used them on the ball example you provided
pawn Код:
public PHY_OnObjectCollideWithSAWorld(objectid, Float:cx, Float:cy, Float:cz) {
if(objectid == dropid || objectid == drop2) {
SendClientMessageToAll(-1, "Reached the ground");
PHY_DeleteObject(dropid);
}
return true;
}
public PHY_OnObjectCollideWithPlayer(objectid, playerid) {
if(objectid == dropid || objectid == drop2) {
SendClientMessageToAll(-1, "Reached the ground");
PHY_DeleteObject(dropid);
}
return true;
}
pawn Код:
new drop2;
CMD:ball(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:ang, Float:vz, Float:mass;
sscanf(params, "F(0.0)F(1.0)", vz, mass);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
new a = CreateObject(1598, x, y, z-0.69, 0, 0, 0);
drop2 = a;
PHY_InitObject(a, 1598, mass, _, PHY_MODE_3D);
PHY_SetObjectVelocity(a, 6.0 * floatsin(-ang, degrees), 6.0 * floatcos(-ang, degrees), vz);
PHY_RollObject(a);
PHY_SetObjectFriction(a, 0.25);
PHY_SetObjectAirResistance(a, 0.1);
PHY_SetObjectGravity(a, 7.1);
PHY_SetObjectZBound(a, _, _, 0.5);
PHY_UseColAndreas(a);
PHY_ToggleObjectPlayerColls(playerid);
return 1;
}