Name: All Knives Into Flashes!Author: MightyScript version: 1.0.0Server version: 2.6.5
Release Date: 12th of July 2010
Description: Script switches Knife into Flashbang. Just throw it and wait till it explodes.
Admin Commands: * /flashmod <0/1> - Script OFF/ON
(default 1) * /flashwait <time> - Time till knife explodes. (counted since hitting something)
(default 3) * /flashlen <time> - Blinding time.
(default 200) * /flashrange <range> - Flash Range
(default 700)Requirements: * Well it would be best if U changed knife dmg to 0, otherways U could kill with "granade". Your choice tho.
Notes: *
Remember that flash spot is place where knife hits, not where it lands!---
---[/size]
Code: {snippets}
(...)
if FlashesOnCount > 0 then
begin
for i:=1 to 128 do
begin
if (Flash[i].Counter > 1) then
begin
if (GetObjectStat(Flash[i].LinkedTo,'active') = true) then // If still on the ground
begin
// countinue countdown
Flash[i].Counter := Flash[i].Counter - 1;
end
else if (GetObjectStat(Flash[i].LinkedTo,'active') = false) then // If picked up during countdown
begin
WriteConsole(0,'Impressive! FlashBang picked up!',Yellow);
Flash[i].Counter := 0; // reset counter
FlashesOnCount := FlashesOnCount - 1; // substract picked knife
Flash[i].CounterStarted := FALSE; // reset vars so the flash can be used again
Flash[i].Used := FALSE;
ObjectLinked[Flash[i].LinkedTo] := FALSE; // unlink the object completely
end;
end;
if (Flash[i].Counter = 1) then // 1 because then there is no 2nd statement needed
begin
Flash[i].BlindMade := TRUE;
Flash[i].Counter := 0;
WriteConsole(0,' * Flash! * ',White);
for j:=1 to MaxPlayers do
if CheckFlash(i,j) = TRUE then Blind(j);
FlashesOnCount := FlashesOnCount - 1;
Flash[i].CounterStarted := FALSE;
Flash[i].Used := FALSE;
ObjectLinked[Flash[i].LinkedTo] := FALSE;
KillObject(Flash[i].LinkedTo); // totaly kill the knife (no longer on map)
end;
end;
end;
(...)
Questions? Bugs? Report please -->
macekmil@gmail.comFrom: July 13, 2010, 03:57:42 am
Update!
Now there is a version that doesn't change all knives into flashbangs, but only one!