Author Topic: Single Flashbang  (Read 10837 times)

0 Members and 1 Guest are viewing this topic.

DarkCrusade

  • Guest
Re: Single Flashbang [Updated to 3.1.0]
« Reply #20 on: July 16, 2010, 09:44:44 am »
@zxy:
So you think that the other conditions are also checked if you go by
Code: [Select]
if (...) then begin
  if (...) then begin

  end;
end;

;D

If you need to handle such a code: (taken from a project by me)
Code: [Select]
if (Copy(Text,1,5) = '/grav') AND (Gravity_Enabled = true) then
  if (GetPiece(Text,' ',1) <> '') then begin
  try
  Tmp2 := StrToFloat(GetPiece(Text,' ',1));
    if (not ModifyGravity(Tmp2)) then
  WriteConsole(ID,'ERROR: Input too high/low. Max: ' + FloatToStr(Gravity_Max) + ', Min: ' + FloatToStr(Gravity_Min), Bad)
else begin
          WriteConsole(ID,'New gravity value: ' + FloatToStr(Tmp2), NotifierColour);
          WriteConsole(0,'Gravity changed.', Yellow);
          WriteLn('Gravity value was changed to ' + FloatToStr(Tmp2));
        end;
except
        WriteConsole(ID,'ERROR: Invalid input', Bad);
      end;
end else WriteConsole(ID,'ERROR: Command: /grav X.XX', Bad);

You must use those if-elses, but more simple code like
Code: [Select]
repeat
  (...)
until (...) or (...);
It's better to use AND/OR statements.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Single Flashbang [Updated to 3.1.0]
« Reply #21 on: July 16, 2010, 03:05:43 pm »
It's better to use AND/OR statements.
it's better to back your points up. Care to elaborate?

DarkCrusade

  • Guest
Re: Single Flashbang [Updated to 3.1.0]
« Reply #22 on: July 16, 2010, 03:23:57 pm »
Visual clearance for example?

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Single Flashbang [Updated to 3.2.0]
« Reply #23 on: July 20, 2010, 01:04:39 pm »
Update to 3.2.0!

Changelog and new download link added to 1st post!
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Single Flashbang [Updated to 3.2.0]
« Reply #24 on: July 20, 2010, 01:54:16 pm »
If you are going to make it working on 2.7.0, that would be better to use InterfaceText function instead of DrawText. So that, it will work with different fonts which are default in different languages. Because InterfaceText's font is same for everyone.

btw, firstly you will have to wait to InterfaceText's scaling bug be fixed.
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Single Flashbang [Updated to 3.2.0]
« Reply #25 on: July 21, 2010, 06:11:54 am »
yeah, I'll have to find another way to check throws :/ This system doesn't work in 2.7.0+
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID