Skip to content

💰 Improved Entity Money Drop System for Ped Death Events#101

Merged
bitpredator merged 2 commits intomasterfrom
dev
Jul 14, 2025
Merged

💰 Improved Entity Money Drop System for Ped Death Events#101
bitpredator merged 2 commits intomasterfrom
dev

Conversation

@bitpredator
Copy link
Copy Markdown
Owner

Summary

This pull request optimizes the server-client logic for handling money drops when an entity (ped) is killed in-game. It introduces a cleaner and safer approach to detecting proximity pickup events and managing pickup cleanup.


✅ Changes Implemented

  • Refactored gameEventTriggered handler to improve performance and readability.
  • Ensured cleanup of money pickup after 15 seconds if not collected.
  • Improved distance check logic and reduced CPU usage with smarter Wait() handling.
  • Replaced generic flags with clear, readable variable names.
  • Added validation for entity existence before operating on it.

🛡️ Benefits

  • Reduces unnecessary server load.
  • Prevents pickup duplication or memory leaks.
  • Ensures secure and proximity-verified rewards.
  • Improves future maintainability of the code.

📌 Related

  • Server-side improvements in money:allowPickupNear and money:tryPickup.

### Summary

This pull request optimizes the server-client logic for handling money drops when an entity (ped) is killed in-game. It introduces a cleaner and safer approach to detecting proximity pickup events and managing pickup cleanup.

---

### ✅ Changes Implemented

- Refactored `gameEventTriggered` handler to improve performance and readability.
- Ensured cleanup of money pickup after 15 seconds if not collected.
- Improved distance check logic and reduced CPU usage with smarter `Wait()` handling.
- Replaced generic flags with clear, readable variable names.
- Added validation for entity existence before operating on it.

---

### 🛡️ Benefits

- Reduces unnecessary server load.
- Prevents pickup duplication or memory leaks.
- Ensures secure and proximity-verified rewards.
- Improves future maintainability of the code.

---

### 📌 Related

- Server-side improvements in `money:allowPickupNear` and `money:tryPickup`.
@bitpredator bitpredator merged commit 42c5eed into master Jul 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant