Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------- Rapid Fire -----------------
- #include <math.h>
- RapidFireLoop()
- {
- if ( (RapidfireActive == true) && (IS_PED_IN_ANY_VEHICLE(PLAYER_PED_ID(),1)==False) && (IS_CONTROL_PRESSED(2,199) && (GET_GAME_TIMER()>=Timeout) )
- {
- FromCoord = GET_PED_BONE_COORDS(PLAYER_PED_ID(),57005,0,0,0)
- ToCoord = GetCoordsInfrontOfCam(75)
- GET_CURRENT_PED_WEAPON(PLAYER_PED_ID,*WeaponID,0)
- SHOOT_SINGLE_BULLET_BETWEEN_COORDS(FromCoord,ToCoo rd,250,0,WeaponID,PLAYER_PED_ID(),1,0,1)
- Timeout = GET_GAME_TIMER() + 50
- }
- }
- Vector3 GetCoordsInfrontOfCam(float distance)
- {
- Vector3 GameplayCamRot = GET_GAMEPLAY_CAM_ROT(2);
- Vector3 GameplayCamCoord = GET_GAMEPLAY_CAM_COORD();
- float tan = Cos(GameplayCamRot.X) * distance);
- float xPlane = Sin(GameplayCamRot.Z * -1.0f) * tan) + GameplayCamCoord.X);
- float yPlane = Cos(GameplayCamRot.Z * -1.0f) * tan) + GameplayCamCoord.Y);
- float zPlane = Sin(GameplayCamRot.X) * distance) + GameplayCamCoord.Z);
- return new Vector3(xPlane, yPlane, zPlane);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement