I would get the x and y coordinates of both the entity and a player.
Like this:
float playerX;
float playerY;
float chairX;
float chairY;
void NudgeChairTowardsPlayer()
{
chairX = GetEntityPosX("theChairEntity");
chairY = GetEntityPosY("theChairEntity");
playerX = GetPlayerPosX();
playerY = GetPlayerPosY();
}
with those variables it's a simple math to get where the player is in relation to the chair. You do that by subtracting the positions. Based on the result you can addPropForce in the right direction.
(optional)
You can add the Z coordinate for pushing even on the Z axis.
You then just need to probably call the NudgeChairTowardsPlayer() function as many times as you want.
EXAMPLE:
float playerX;
float playerY;
float chairX;
float chairY;
void NudgeChairTowardsPlayer()
{
chairX = GetEntityPosX("theChairEntity");
chairY = GetEntityPosY("theChairEntity");
playerX = GetPlayerPosX();
playerY = GetPlayerPosY();
float playerXinRelationToChair = playerX - chairX;
float playerYinRelationToChair = playerY - chairY;
// These will be basically the distance between the chair and the player.
// Now you can for example multiply the distance to get a strong enough
// push. According to script wiki the values are ~100 (weak) to ~10000
// (strong)
float forceMultiplier = 500; // Play around with this value.
AddPropForce("theChairEntity", playerXinRelationToChair * forceMultiplier, playerYinRelationToChair * forceMultiplier, 0.0f, "world");
}
Keep in mind, that I haven't tested this code and it serves mainly as a "nudge" in the right direction.
Hope you find it useful.