Author Topic: What am I doing wrong?  (Read 1677 times)

0 Members and 1 Guest are viewing this topic.

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
What am I doing wrong?
« on: May 20, 2008, 03:47:49 pm »
Sry 'bout the low quality, couldn't bother optimizing it.


Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: What am I doing wrong?
« Reply #1 on: May 20, 2008, 04:00:28 pm »
for starters, the if (GetPlayerStat yadayadaya block isn't in a procedure.
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: What am I doing wrong?
« Reply #2 on: May 20, 2008, 04:02:18 pm »
Quote
if (GetPlayerStat(ID,'kills')) > 3 then begin
    SetWeaponActive(ID,1,0);
end;
That isn't in any procedure or function.


And use Notepad++
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #3 on: May 20, 2008, 04:03:01 pm »
...but it is a(n)...

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: What am I doing wrong?
« Reply #4 on: May 20, 2008, 04:06:29 pm »
Also, the SetWeaponActive stuff will reset when the player joins a team (or changes), so you might want to put it somewhere there instead.

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #5 on: May 20, 2008, 04:07:54 pm »
Where do I put the 'if' thing?

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: What am I doing wrong?
« Reply #6 on: May 20, 2008, 04:17:29 pm »
sense this isn't for programming, you can't put code in the middle of nowhere, it must go within a function or procedure..

Where do I put the 'if' thing?
It depends on what it is.. It looks like you have checking a person's kill count, which would be logical to put in OnPlayerKill;
(note that the player's actual kill count may be one less while using GetPlayerStat for kills, and you may need to add one to it)

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #7 on: May 21, 2008, 09:11:41 am »
OK, but still not working.


Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline rumpel

  • Camper
  • ***
  • Posts: 410
Re: What am I doing wrong?
« Reply #8 on: May 21, 2008, 09:22:51 am »
i guess u need to add a ; after the id,1,0 ;o?
banned.

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #9 on: May 21, 2008, 09:25:40 am »
Done, but still ain't working.

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: What am I doing wrong?
« Reply #10 on: May 21, 2008, 09:32:29 am »
OK, but still not working.



Procedures must be start with begin and end with end;.

procedure OnPlayerKill(Kills, Victim: byte; Weapon: string);
begin
  if (GetPlayerStat(ID,'kills')) > 3 then begin
    SetWeaponActive(ID,1,0);
  end;
end;
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #11 on: May 21, 2008, 09:51:44 am »
Yeah I already tested that, but it still ain't working.

When I delete my stuff it works, so there MUST be something wrong with that little part.

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: What am I doing wrong?
« Reply #12 on: May 21, 2008, 10:17:37 am »
What's the error message...?

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #13 on: May 21, 2008, 10:53:16 am »
Code: [Select]
08-05-21 17:51:30    Console Log Started
08-05-21 17:51:30 Welcome to Soldat 1.4.2
08-05-21 17:51:30  [*] ScriptCore v2.2 loaded! Found 4 scripts...
08-05-21 17:51:30  [*] Compiling Custom Advance BETA -> Core.pas...
08-05-21 17:51:30  [*] Compiling Custom Advance BETA -> NetworkCore.pas...
08-05-21 17:51:30  [*] Compiling Custom Advance BETA -> AdminCore.pas...
08-05-21 17:51:30  [*] Custom Advance BETA -> [Error] (120:20): Unknown identifier 'ID'
08-05-21 17:51:30  [*] Compiling F3Y Server -> Core.pas...
08-05-21 17:51:30  [*] Compiling F3Y Server -> NetworkCore.pas...
08-05-21 17:51:30  [*] Compiling F3Y Server -> AdminCore.pas...
08-05-21 17:51:30  [*] Compiling Spawner v1.5F -> Core.pas...
08-05-21 17:51:30  [*] Compiling Spawner v1.5F -> NetworkCore.pas...
08-05-21 17:51:30  [*] Compiling Spawner v1.5F -> AdminCore.pas...
08-05-21 17:51:30  [*] Compiling Zombie Match Switch v0.9 -> Core.pas...
08-05-21 17:51:30  [*] Compiling Zombie Match Switch v0.9 -> NetworkCore.pas...
08-05-21 17:51:30  [*] Compiling Zombie Match Switch v0.9 -> AdminCore.pas...
08-05-21 17:51:30 Shutting down server...
08-05-21 17:51:30 Shutting down admin server...
08-05-21 17:51:30 Shutting down ScriptCore...

UNKOWN IDENTIFIER

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: What am I doing wrong?
« Reply #14 on: May 21, 2008, 11:53:39 am »
Hehe, we're all idiots. I dunno if its the line 120 error, but you have 'ID' in the OnPlayerKill part, you need to choose 'killer' or 'victim'.

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #15 on: May 22, 2008, 11:33:13 am »
Hehe, you're still an idiot... (joke)

Changing ID to killer in that part didn't work either.

Here's what I did:

Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
  if GetPlayerStat(Killer,'kills') > 3 then begin
    SetWeaponActive(Killer,1,0);
  end;
end;

And what I got:

Code: [Select]
08-05-22 18:28:53    Console Log Started
08-05-22 18:28:53 Welcome to Soldat 1.4.2
08-05-22 18:28:53  [*] ScriptCore v2.2 loaded! Found 4 scripts...
08-05-22 18:28:53  [*] Compiling Custom Advance BETA -> Core.pas...
08-05-22 18:28:53  [*] Compiling Custom Advance BETA -> NetworkCore.pas...
08-05-22 18:28:53  [*] Compiling Custom Advance BETA -> AdminCore.pas...
08-05-22 18:28:53  [*] Custom Advance BETA -> [Error] (121:32): Type mismatch
08-05-22 18:28:53  [*] Compiling F3Y Server -> Core.pas...
08-05-22 18:28:53  [*] Compiling F3Y Server -> NetworkCore.pas...
08-05-22 18:28:53  [*] Compiling F3Y Server -> AdminCore.pas...
08-05-22 18:28:53  [*] Compiling Spawner v1.5F -> Core.pas...
08-05-22 18:28:53  [*] Compiling Spawner v1.5F -> NetworkCore.pas...
08-05-22 18:28:53  [*] Compiling Spawner v1.5F -> AdminCore.pas...
08-05-22 18:28:53  [*] Compiling Zombie Match Switch v0.9 -> Core.pas...
08-05-22 18:28:53  [*] Compiling Zombie Match Switch v0.9 -> NetworkCore.pas...
08-05-22 18:28:53  [*] Compiling Zombie Match Switch v0.9 -> AdminCore.pas...
08-05-22 18:28:53 Shutting down server...
08-05-22 18:28:53 Shutting down admin server...
08-05-22 18:28:53 Shutting down ScriptCore...

TYPE MISMATCH

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: What am I doing wrong?
« Reply #16 on: May 22, 2008, 01:18:52 pm »
SetWeaponActive(Killer, 1, 0); should be SetWeaponActive(Killer, 1, false);

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #17 on: May 22, 2008, 01:33:56 pm »
No, I want to set the weapon ON THE LIST, not take it off.

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: What am I doing wrong?
« Reply #18 on: May 22, 2008, 01:35:45 pm »
Well, you had 0, which usually means false. Put true instead...

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: What am I doing wrong?
« Reply #19 on: May 22, 2008, 01:42:25 pm »
Well, in EnEsCe's manual, it says put 0 or false or something, but yeah I figured that out by myself. The problem was that I actually had 2 problems in one so when I fixed one, there was still the other one active.

Thanks alot Boble for your kind help. ;)

Death is the solution to all problems. No man; no problem.
-Joseph Stalin