Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if !defined MAX_MOVE_OBJECT
- #define MAX_MOVE_OBJECT 3
- #endif
- enum e__OBJECT_MOVED_INFO {
- gObjectid,
- bool: isMove
- }
- new ObjectInfo[ MAX_MOVE_OBJECT ][ e__OBJECT_MOVED_INFO ];
- enum e__OBJECT_ARRAY_INFO {
- gmModel,
- Float: gmObjectX,
- Float: gmObjectY,
- Float: gmObjectZ,
- Float: gmEndX,
- Float: gmEndY,
- Float: gmEndZ,
- }
- new array_move_object[ MAX_MOVE_OBJECT ][ e__OBJECT_ARRAY_INFO ] =
- {
- {3930, -47.661, 1515.25, 14.451, -930.3621,-1837.6702,90.3852 },
- {3930, -63.22, 1519.28699, 14.451, -930.3621,-1837.6702,90.3852 },
- {3930, -47.156, 1531.86499, 14.451, -930.3621,-1837.6702,90.3852 }
- };
- public OnFilterScriptInit() {
- for(new i; i < MAX_MOVE_OBJECT; i ++) {
- ObjectInfo[i][gObjectid] = CreateDynamicObject(
- array_move_object[i][gmModel],
- array_move_object[i][gmObjectX],
- array_move_object[i][gmObjectY],
- array_move_object[i][gmObjectZ],
- 0.0, 0.0, 0.0
- );
- ObjectInfo[i][isMove] = true;
- MoveDynamicObject(
- ObjectInfo[i][gObjectid],
- array_move_object[i][gmEndX],
- array_move_object[i][gmEndY],
- array_move_object[i][gmEndZ],
- 0.2
- );
- }
- return true;
- }
- public OnDynamicObjectMoved(objectid)
- {
- new Float: x, Float: y, Float: z;
- for(new i; i < MAX_MOVE_OBJECT; i ++) {
- GetDynamicObjectPos(ObjectInfo[i][gObjectid], x, y, z );
- if((ObjectInfo[i][isMove] = !ObjectInfo[i][isMove]))
- MoveDynamicObject(ObjectInfo[i][gObjectid],x,y,z-0.2, 0.2, 0, 0, 180);
- else
- MoveDynamicObject(ObjectInfo[i][gObjectid], x, y, z+0.2, 0.2, 0, 0, 180);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement