Problems with Objects Physics
#1

Hi,
i found an include for Objects Physics wich handles via script collisions and other physics of the objects. I have tried everything to move an object with this thing but it wont work, it tells me the message that i added that the object is moving but nothing ... This is the include im using

Thats my Code:
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if ((
newkeys KEY_FIRE) && !(oldkeys KEY_FIRE))
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            new 
vehID GetPlayerVehicleID(playerid);
            if(
vehicle[vehID][guns] == false)
            {
                
vehicle[vehID][guns] = true;
                
//for(new i = 0; i < 101; i++)
                //{
                    
if(vehicle[vehID][guns] == true)
                    {
                        new 
Float:xFloat:yFloat:zFloat:rz;
                        
GetVehiclePos(vehIDxyz);
                        
GetVehicleZAngle(vehIDrz);
                        new 
obj CreateObject(1603xyz0.00.0rz);
                        
PHY_InitObject(obj16031.0FLOAT_NANPHY_MODE_2D);
                        
PHY_SetObjectVelocity(obj10.010.010.0);
                        
PHY_SetObjectAcceleration(obj10.010.010.0);
                        
SendClientMessage(playerid1"Erfolgreich");
                        
                        if(
PHY_IsObjectMoving(obj))
                        {
                            
SendClientMessage(playerid1"Hi");
                        }
                    }
                
//}
            
}
            else
            {
                
vehicle[vehID][guns] = false;
            }
        }
    }
    return 
1;

I got both messages that everything workes and it created the object but it didnt move ... I hope you know what i did wrong

Thanks
Reply
#2

Did someone know how the Physiks works?
Reply
#3

Or do someone know another way to move an object in a direction and check collisions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)