0 Members and 1 Guest are viewing this topic.
(...)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 - does it include:1. line-of-sight?2. less time/less blinding if relatively far?
Sometimes flashes just don't blow up. I actually don't have any idea why but I'm gonna check it more minutely. For now: just change your weapons few times both before and after using "/flash" cmd. Let's say you arm your nade that way
if (...) then begin if (...) then begin if (...) then begin (.....) end; end;end;
if (...) AND (...) AND (...) then begin (.....)end;
if (ABC = true) then begin if (DEF = false) then begin (.....) end;end;
if (ABC) AND (not DEF) then begin (.....)end;
Instead of...Code: [Select]if (...) then begin if (...) then begin if (...) then begin (.....) end; end;end;...you can just use:Code: [Select]if (...) AND (...) AND (...) then begin (.....)end;
Quote from: DarkCrusade on July 15, 2010, 12:40:53 pmInstead of...Code: [Select]if (...) then begin if (...) then begin if (...) then begin (.....) end; end;end;...you can just use:Code: [Select]if (...) AND (...) AND (...) then begin (.....)end;Actually the first option is faster especially with heavy functions in conditions. If the first one is false then the rest is not checked unlike in the second example.Also AND does not have to be written in upper case
if (condition1) thenif (condition2) then...else...;
If it's like C, then I believe you are mistaken. as soon as the first false result occurs, it skips the rest. or is that just compiler-optimization? or are all conditions rendered first in soldat core?
at any rate i case i have a question (if someone can answer )Code: [Select]if (condition1) thenif (condition2) then...else...;under which if-statement is does the else-statement operate. Is it the same in C as it is in soldat?