Unique idea, as I said to you
Hmmm, possible solution maybe is to make the moving objects (bar, weights) have unique id reference.
I'll use the bar as an example.
Код:
new ObjBAR; // example ObjBAR=CreateObject( ......
new ObjBAR_ACTIVE=-1;
Then, a command. This is to start the weight lifting. (Also to prevent other people doing the same job/routine).
Код:
ObjBAR_ACTIVE=playerid; // good idea would be to add the playerid here
AttachObjectToPlayer, unsure what will happen, but if it reacts the same as single player it should be OK.
Perhaps use a timer too, a SetTimerEx to maintain the position of the one player (500 milliseconds, repeat).
The new IsPlayerInRangeOfPoint could also be used in the SetTimerEx, if range is over 2.0 away from the benchpress, kill the timer. SetObjectPos back to the benchpress, then set the value of ObjBAR_ACTIVE back to -1.
This is a new and unique feature, goodluck with it. Untested idea above, but it's what I would try.
EDIT: Just browsed the GTA Single Player code and found a function SA-MP doesn't have that would enable this.
Код:
0619: enable_actor $PLAYER_ACTOR collision_detection 0
Here is some code that might help you (might not though lol)
http://pastebin.com/m7a354d4f