Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: mods/deathmatch/logic/CClientGame.cpp
- ===================================================================
- --- mods/deathmatch/logic/CClientGame.cpp (revision 3916)
- +++ mods/deathmatch/logic/CClientGame.cpp (working copy)
- @@ -2602,6 +2602,8 @@
- m_Events.AddEvent ( "onClientPlayerVoiceStop", "", NULL, false );
- m_Events.AddEvent ( "onClientPlayerStealthKill", "target", NULL, false );
- m_Events.AddEvent ( "onClientPlayerHitByWaterCannon", "vehicle", NULL, false );
- + m_Events.AddEvent ( "onClientPlayerPickupHit", "pickup, matchingDimension", NULL, false );
- + m_Events.AddEvent ( "onClientPlayerPickupLeave", "pickup, matchingDimension", NULL, false );
- // Ped events
- m_Events.AddEvent ( "onClientPedDamage", "attacker, weapon, bodypart", NULL, false );
- Index: mods/shared_logic/CClientPickup.cpp
- ===================================================================
- --- mods/shared_logic/CClientPickup.cpp (revision 3916)
- +++ mods/shared_logic/CClientPickup.cpp (working copy)
- @@ -21,7 +21,7 @@
- // Initialize
- m_pManager = pManager;
- m_pPickupManager = pManager->GetPickupManager ();
- - m_usModel = usModel;
- + m_usModel = usModel;
- m_bVisible = true;
- m_pPickup = NULL;
- m_pObject = NULL;
- @@ -188,11 +188,19 @@
- {
- if ( IS_PLAYER ( &Entity ) )
- {
- - // Call the pickup hit event
- + bool bMatchingDimensions = (GetDimension () == Entity.GetDimension ()); // Matching dimensions?
- +
- + // Call the pickup hit event (source = pickup that was hit)
- CLuaArguments Arguments;
- - Arguments.PushElement ( &Entity ); // player that hit it
- - Arguments.PushBoolean ( ( GetDimension () == Entity.GetDimension () ) ); // matching dimension?
- + Arguments.PushElement ( &Entity ); // The element that hit the pickup
- + Arguments.PushBoolean ( bMatchingDimensions );
- CallEvent ( "onClientPickupHit", Arguments, true );
- +
- + // Call the player pickup hit (source = player that hit the pickup)
- + CLuaArguments Arguments2;
- + Arguments2.PushElement ( this ); // The pickup that was hit
- + Arguments2.PushBoolean ( bMatchingDimensions );
- + Entity.CallEvent ( "onClientPlayerPickupHit", Arguments2, true );
- }
- }
- @@ -201,10 +209,18 @@
- {
- if ( IS_PLAYER ( &Entity ) )
- {
- - // Call the pickup leave event
- + bool bMatchingDimensions = (GetDimension () == Entity.GetDimension ()); // Matching dimensions?
- +
- + // Call the pickup leave event (source = the pickup that was left)
- CLuaArguments Arguments;
- - Arguments.PushElement ( &Entity ); // player that hit it
- - Arguments.PushBoolean ( ( GetDimension () == Entity.GetDimension () ) ); // matching dimension?
- - CallEvent ( "onClientPickupLeave", Arguments, true );
- + Arguments.PushElement ( &Entity ); // The element that left the pickup
- + Arguments.PushBoolean ( bMatchingDimensions );
- + CallEvent ( "onClientPickupLeave", Arguments, true);
- +
- + // Call the player pickup leave event (source = the player that left the pickup)
- + CLuaArguments Arguments2;
- + Arguments2.PushElement ( this ); // The pickup that was left (this)
- + Arguments2.PushBoolean ( bMatchingDimensions );
- + Entity.CallEvent ( "onClientPlayerPickupLeave", Arguments2, true );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement