rendered paste bodynew tmrweap[373], cycle;
new pModelID[46] = {
331, 333, 334, 335,
336, 337, 338, 339,
341, 321, 322, 323,
324, 325, 326, 342,
343, 344, 330, 330,
330, 346, 347, 348,
349, 350, 351, 352,
353, 355, 356, 372,
357, 358, 359, 360,
361, 362, 363, 364,
365, 366, 367, 368,
369, 371};
stock CreatePickupAndDestroy(playerid, id)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
CreatePickup(id, 3, X,Y,Z);
tmrweap[id] = SetTimerEx("WeaponDestroy", 20000, 1, "d", id);
}
public OnPlayerDeath(playerid, killerid, reason)
{
new w = GetPlayerWeapon(playerid);
if (w > 0 && w < 19 || w > 21 && w < 47)
{
CreatePickupAndDestroy(playerid, pModelID[w-1]);
}
return 1;
}
public WeaponDestroy(pickupid)
{
cycle ++;
if (cycle)
{
DestroyPickup(pickupid);
cycle = 0;
KillTimer(tmrweap[pickupid]);
}
}