Author Topic: Problem with DoDamage (not allowed weapon)  (Read 1278 times)

0 Members and 1 Guest are viewing this topic.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Problem with DoDamage (not allowed weapon)
« on: June 23, 2007, 06:36:29 pm »
I'm not good at scripting and I've got problem with one of my scripts:

Code: [Select]
var i: longint;

  if Text = '/test' then
    for i := 1 to 32 do begin
      repeat
        DoDamage(i, 1);
      until GetPlayerStat(i, 'Health') <= 0;
        Sleep(100);
    end;

It seems to work fine, but when I'm moving mouse, server shows 'fri_ is cheating - not allowed weapon'. When I rejoined, there were only four weapons available to choose - DEs, MP5, AK and Steyr. Somehow server didn't show 'not allowed weapon', when i used /test with one of these weapons.

What is wrong with this script?
« Last Edit: August 20, 2020, 04:47:45 pm by freestyler »

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Problem with DoDamage (not allowed weapon)
« Reply #1 on: June 23, 2007, 08:53:38 pm »
first of all I'd recommend not use sleep - it'll just lag up ur script.
Instead have a boolean array of 32 (one for each player) called RapeThisPlayer or something and set it true when he's being raped (turn it off when he dies).  Next under AppOnIdle (called once every second) type:

Code: [Select]
for i := 1 to 32 do
If RapeThisPlayer[i] then DoDamage(i, 2);

I dunno exactly where you put your code but just stay away from sleep inmo.
With the code I gave you, your player loses 4/3 % (1.33%) health every second killing him in 75 seconds on full health.  Note that the max health is 150.  Hope this helps ;D
Can't think of anything original to put here...

Offline deguix

  • Major
  • *
  • Posts: 79
Re: Problem with DoDamage (not allowed weapon)
« Reply #2 on: June 24, 2007, 05:43:56 am »
150 is for 100% health. 200 is for 133% health (which is the max).

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Problem with DoDamage (not allowed weapon)
« Reply #3 on: June 25, 2007, 06:24:10 am »
Im having this bug too, VERY annoying as its spamming my logs.. 12 people getting 1-2 errors a second.. no fun

Offline deguix

  • Major
  • *
  • Posts: 79
Re: Problem with DoDamage (not allowed weapon)
« Reply #4 on: June 28, 2007, 07:31:39 am »
That problem only happens when you disable the weapon in soldat.ini that is used in the server.

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Problem with DoDamage (not allowed weapon)
« Reply #5 on: June 28, 2007, 10:20:42 am »
Nope, it was happening with people using knives in the US server, hence it is now disabled.