Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SMASHING PEDS
- // ©2009-2011 LouNGeR
- // THIS IS NOT A COMPLETE SCRIPT, It's just a code snippet
- // showing how to "smash" peds as seen on this video:
- // http://www.youtube.com/watch?v=XJjhQxQ_Hr0
- #define IsNull(x) (x.Handle == 0)
- Player LouNGeRClass::PlayerIndex() {
- return ConvertIntToPlayerIndex(GetPlayerId());
- }
- Ped LouNGeRClass::PlayerChar() {
- Ped p;
- GetPlayerChar(PlayerIndex(), &p);
- return p;
- }
- bool LouNGeRClass::IsPedReady(Ped p) {
- return (!IsNull(p) && !IsCharDead(p));
- }
- void LouNGeRClass::ClosePedTest() {
- Ped p = PlayerChar();
- Ped closePed;
- f32 x, y, z;
- GetCharCoordinates(p, &x, &y, &z);
- GetClosestChar(x, y, z, 20.0, true, true, &closePed);
- if(IsCharVisible(closePed) && IsPedReady(closePed)) {
- SmashPed(closePed);
- }
- }
- void LouNGeRClass::SmashPed(Ped p) {
- ApplyForceToPed(p, 1, 0.0, 0.0, 15.0, 0.0, 0.0, 0.0, 7, 1, 1, 1); // Up
- m_pThread->Wait(250);
- ApplyForceToPed(p, 1, 0.0, 0.0, -150.0, 0.0, 0.0, 0.0, 7, 1, 1, 1); // Down
- }
Advertisement
Add Comment
Please, Sign In to add comment