Author Topic: OnJoinTeam Error  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
OnJoinTeam Error
« on: May 11, 2009, 03:26:32 pm »
Hai, I just added this script in an OnJoinTeam Procedure
Code: [Select]
procedure OnJoinTeam(ID, Team: byte);
 Var
B: Byte;
 Begin
 For B:= 1 To 32 Do
 PickedClass[B]:=0;
          IF PickedClass[B] = 0 Then Command('/SETTEAM5 '+inttostr(B));           
 end;
It puts the PickedClass To 0 as normal, but it doesn't put the player in spectator, what do i need to do?

Thanks =]

People will recognize the script lol

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: OnJoinTeam Error
« Reply #1 on: May 11, 2009, 03:31:26 pm »
have you tried Command('/setteam5 '+inttostr(B)); ? the commands might be case-sensitive

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: OnJoinTeam Error
« Reply #2 on: May 11, 2009, 04:56:05 pm »
Commands are not case sensitive.

First of all be sure that you only setteam players who are active:
Code: [Select]
If (PickedClass[B] = 0) and (getPlayerStat(ID, 'Active') = true) then Command('/setteam5 '+inttostr(B));

Second, if you're testing this with bots, I'm pretty sure you can't have the scriptcore setteam them for some reason.
Come join: EliteCTF
Listen to: My Music

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: OnJoinTeam Error
« Reply #3 on: May 11, 2009, 04:58:42 pm »
(I dont use bots :p)
Yep, while you were i writing i modified it. But i put this
Code: [Select]
procedure OnJoinGame(ID, Team: byte);
 Begin
 Command('/SETTEAM5 '+inttostr(ID));
 if GetPlayerStat(ID, 'Human') Then Begin PickedClass[ID]:=0;           
 end else if PickedClass[ID] > 0 Then Command('/SETTEAM1 '+inttostr(ID));
 end;
And it works well, i will ask you, does the Human is the same thing as active ? If not, what's the difference ?
« Last Edit: May 11, 2009, 05:00:42 pm by VinceBros »

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: OnJoinTeam Error
« Reply #4 on: May 11, 2009, 09:31:11 pm »
Active tells you if there's anyone there. Human tells you if its a player or a bot.
...and headbutt the sucker through your banana suit!