Author Topic: editing weapons with a script?  (Read 756 times)

0 Members and 1 Guest are viewing this topic.

Offline Nubism

  • Major
  • *
  • Posts: 58
editing weapons with a script?
« on: December 01, 2008, 11:40:58 am »
is it possible to edit a weapon with a script that it can shot knives or if i got a m79 that it can shot twice if i type !edit as example without restarting server?

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: editing weapons with a script?
« Reply #1 on: December 01, 2008, 12:08:39 pm »
Fistbox features that.

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: editing weapons with a script?
« Reply #2 on: December 21, 2008, 05:29:05 am »
I made what u want, its just: It wonts compile:

The Error:
  • ScriptCore v2.2 loaded! Found 3 scripts...
  • Compiling default -> Core.pas...
  • Compiling default -> NetworkCore.pas...
  • Compiling default -> AdminCore.pas...
  • default -> [Error] (48:1): Identifier expected[/i]
  • Compiling FunAdmin -> FunAdmin.pas...
  • Compiling Nick Reg -> NickRegistration.pas...[/b]

    maybe u can start something with it:

    Code: [Select]
    function OnCommand(ID: Byte; Text: string): boolean;
    begin

    var
    ini: TINIFile;

      if (GetPiece(Text, ' ',1) = '/editwep') then begin
      iniSetValue(ini, GetPiece (Text,' ',3), GetPiece (Text,' ',4), GetPiece (Text,' ',5));
      iniSave(GetPiece (Text,' ',2), ini); // must call to save changes
      end;

      if (GetPiece(Text, ' ', 1) = '/dis') then begin
      SetWeaponActive(0, GetPiece(Text,' ', 2), false);
      end;

      if (GetPiece(Text, ' ', 1) = '/en') then begin
      SetWeaponActive(0, GetPiece(Text,' ', 2), true);
      end;

      if (GetPiece(Text, ' ', 1) = '/disID') then begin
      SetWeaponActive(GetPiece(Text,' ',2),GetPiece(Text,' ',3), false);
      end;

      if (GetPiece(Text, ' ', 1) = '/enID') then begin
      SetWeaponActive(GetPiece(Text,' ',2),GetPiece(Text,' ',3), true);
      end;

      Result := false; // Return true if you want to ignore the command typed.
    end;

    Put this to Core.pas in ur default folder
    If u have dedected the error, please say me  ;D