Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script 649 (int index, int dropped, int weaponstay)
- {
- int classslot = dakkaClassNum() + 1;
- if (index < 0 || index >= PICKUPCOUNT) { SetResultValue(0); terminate; }
- int doPickup = 1;
- int didPickup = 0;
- int ammoMult = 1.0;
- if (dropped) { ammoMult /= 2; }
- if (GetCVar("sv_doubleammo")) { ammoMult *= 2; }
- if (!doPickup)
- {
- SetResultValue(0);
- terminate;
- }
- int i, item, count, startcount, endcount, countinv, ammo, wep;
- int oldammo;
- for (i = 0; i < PICKUPSLOTCOUNT; i++)
- {
- item = DakkaPickups[classslot][index][i];
- count = DakkaPickupCounts[classslot][index][i];
- countinv = DakkaPickup_GoesIntoInventory[classslot][index][i];
- ammo = isAmmo(item);
- wep = getKnownWeaponIndex(item);
- if (ammo) { count = FixedMul(ammoMult, count); }
- if (StrLen(item) == 0 || count == 0) { continue; }
- //Log(s:"Would get ", d:count, s:" of ", s:item, s:" (is ", s:cond(ammo, "", "not "),
- // s:"ammo); would ", s:cond(countinv, "", "not "), s:"count inventory");
- Log(s:"We do", s:cond(wep != -1, "", "n't"), s:" know of weapon ", s:item);
- startcount = CheckInventory(item);
- GiveAmmo(item, count);
- endcount = CheckInventory(item);
- if (countinv) { didPickup |= (startcount < endCount); }
- else { didPickup = 1; }
- }
- if (didPickup)
- {
- ACS_ExecuteAlways(647, 0, PlayerNumber(), index, 0);
- }
- SetResultValue(didPickup);
- if (weaponstay && GetCVar("sv_weaponstay")) { SetResultValue(0); }
- }
- script 647 (int pln, int index, int flags) clientside
- {
- int classslot = dakkaClassNum() + 1;
- int message = chooseMessage(classslot, index);
- int silent = !!(GetCvar("compat_silentpickup"));
- int pkupSound = DakkaPickupSounds[classslot][index];
- if (ConsolePlayerNumber() == pln)
- {
- Log(s:msgColors[GetCVar("msg0color")], s:message);
- if (silent)
- {
- LocalAmbientSound(pkupSound, 127);
- }
- int r = DakkaPickupFlashes[classslot][index][0];
- int g = DakkaPickupFlashes[classslot][index][1];
- int b = DakkaPickupFlashes[classslot][index][2];
- int i = DakkaPickupFlashes[classslot][index][3];
- int t = DakkaPickupFlashes[classslot][index][4];
- FadeRange(r, g, b, i, r, g, b, 0, t);
- }
- if (!silent)
- {
- ActivatorSound(pkupSound, 127);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement