Author Topic: Var and team check  (Read 625 times)

0 Members and 1 Guest are viewing this topic.

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Var and team check
« on: July 12, 2009, 02:01:48 pm »
I tried to write a script which checks var and team of a joining player and then forces him to spectator if he's not joining as spectator already, but something is wrong:

Code: [Select]
procedure OnJoinGame(ID, Team: byte);
begin
if cw := true then
if GetPlayerStat(ID, 'Team') = 5 then
WriteLn('Spec joined.');
else
begin
Command('/setteam5 '+IntToStr(ID));
WriteConsole(ID,'You were forwarded to a spectator!',RGB(255,0,0));
end;
end;
What's wrong?

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: Var and team check
« Reply #1 on: July 12, 2009, 02:29:30 pm »
Code: [Select]
WriteLn('Spec joined.');
Delete the semicolon (;)

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Var and team check
« Reply #2 on: July 12, 2009, 03:00:45 pm »
True, thanks ;).