rendered paste body#define FILTERSCRIPT#include <a_samp>#include <foreach>#include <pstream>#define MAX_WEAPON_SLOT 12#define MAX_WEAPON_PICKUPS 100#define PICKUP_TIMEOUT 30000#define PICKUP_TYPE 19#define near(%1) \ (%1 + (3 * floatsin(random(cellmax)))) enum e_WPICKUP{ e_WPICKUP_MODEL, e_WPICKUP_WEAPON, e_WPICKUP_AMMO, }enum e_PWEAPON{ e_PWEAPON_PICKUP, e_PWEAPON_MAX_AMMO, }new gPickups[PSTREAM_MAX_PICKUPS][e_WPICKUP];new gWeaponModels[][e_PWEAPON] = { {0, 0}, {331, 1}, // Brass Knuckles {333, 1}, // Golf Club {334, 1}, // Police Truncheon/Night Stick {335, 1}, // Combat Knife {336, 1}, // Baseball Bat {337, 1}, // Shovel {338, 1}, // Pool Cue {339, 1}, // Katana {341, 1}, // Chainsaw {321, 1}, // Regular Dildo {322, 1}, // White Dildo {323, 1}, // Vibrator {324, 1}, // Another Vibrator {325, 1}, // Flowers {326, 1}, // Cane {342, 50}, // Frag Grenade {343, 50}, // Tear Gas Grenade {344, 50}, // Molotov Cocktail {0, 0}, {0, 0}, {0, 0}, {346, 100}, // Colt 45 Pistol {347, 100}, // Silenced Pistol {348, 200}, // Desert Eagle {349, 100}, // Regular Shotgun {350, 500}, // Sawn-Off Shotgun {351, 500}, // Combat Shotgun {352, 500}, // Micro Uzi {353, 100}, // MP5 {355, 300}, // AK47 Assault Rifle {356, 300}, // M4 Assault Rifle {372, 500}, // Tec-9 {357, 50}, // Country Rifle {358, 50}, // Sniper Rifle {359, 10}, // Rocket Launcher {360, 10}, // Heat Seeking Rocket Launcher {361, 500}, // Flamethrower {362, 500}, // Minigun {363, 20}, // Satchel Charges {364, 20}, // Detonator <---- Seemingly Useless {365, 500}, // Spray Paint Can {366, 250}, // Fire Extinguisher {367, 10}, // Camera {371, 1} // Parachute } forward DestroyWeaponPickupDelay(pickupid); public OnFilterScriptExit(){ for (new pickup; pickup < PSTREAM_MAX_PICKUPS; pickup++) { DestroyWeaponPickup(pickup); } return 1;} public OnPlayerDeath(playerid, killerid, reason){ new weapon, ammo, Float:x, Float:y, Float:z, world = GetPlayerVirtualWorld(killerid); GetPlayerPos(playerid, x, y, z); for (new slot; slot < MAX_WEAPON_SLOT; slot++) { GetPlayerWeaponData(playerid, slot, weapon, ammo); CreateWeaponPickup(weapon, ammo, near(x), near(y), z, world); } return 1;}public OnPlayerPickUpPickup(playerid, pickupid){ pickupid = GetStreamedPickupID(pickupid); if (pickupid > 0 && gPickups[pickupid][e_WPICKUP_MODEL]) { new weapon = GetPlayerWeapon(playerid); GivePlayerWeapon(playerid, gPickups[pickupid][e_WPICKUP_WEAPON], gPickups[pickupid][e_WPICKUP_AMMO]); SetPlayerArmedWeapon(playerid, weapon); DestroyWeaponPickup(pickupid); } return 1;}CreateWeaponPickup(weapon, ammo, Float:x, Float:y, Float:z, world){ ammo = clamp(ammo, 0, gWeaponModels[weapon][e_PWEAPON_MAX_AMMO]); if (ammo && gWeaponModels[weapon][e_PWEAPON_PICKUP]) { new pickup = CreateStreamedPickup(gWeaponModels[weapon][e_PWEAPON_PICKUP], PICKUP_TYPE, x, y, z, world); if (pickup > 0) { gPickups[pickup][e_WPICKUP_MODEL] = gWeaponModels[weapon][e_PWEAPON_PICKUP]; gPickups[pickup][e_WPICKUP_WEAPON] = weapon; gPickups[pickup][e_WPICKUP_AMMO] = ammo; SetTimerEx("DestroyWeaponPickupDelay", PICKUP_TIMEOUT, false, "i", pickup); return pickup; } } return -1;}DestroyWeaponPickup(pickupid){ if (gPickups[pickupid][e_WPICKUP_MODEL]) { gPickups[pickupid][e_WPICKUP_MODEL] = 0; return DestroyStreamedPickup(pickupid); } return -1; }public DestroyWeaponPickupDelay(pickupid){ return DestroyWeaponPickup(pickupid);}