Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- /*
- [- Drop Player's Items On Death -]
- [-- Version 1 -]
- [-- Author: pownayge @sa-mp.com -]
- */
- #define MONEY_BAG 1550
- #define MONEY_STACK 1220
- new playerPickups[MAX_PICKUPS];
- public OnFilterScriptInit()
- {
- print("\tItem Death loaded\n");
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)
- {
- new Float:x, Float:y, Float:z;
- new oldmoney = GetPlayerMoney(playerid);
- GetPlayerPos(playerid, x, y, z);
- ResetPlayerMoney(playerid);
- //Only drop if the player has atleast $1
- if(oldmoney > 0)
- {
- new object = MONEY_STACK;
- if(oldmoney >= 20000)
- {
- object = MONEY_BAG;
- }
- //Create the pickup & return the id
- //Set the id to how much money was dropped
- playerPickups[CreatePickup(object, 2, x, y, z, -1)] = oldmoney;
- }
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(playerPickups[pickupid] != EOS)
- {
- GivePlayerMoney(playerid, playerPickups[pickupid]);
- DestroyPickup(pickupid);
- playerPickups[pickupid] = EOS;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement