Author Topic: Script Problem  (Read 882 times)

0 Members and 1 Guest are viewing this topic.

Offline KwS Pall

  • Major(1)
  • Posts: 49
  • I'm going to write Tibia for Soldat
Script Problem
« on: November 28, 2007, 11:54:53 am »
i have a problem with this line:
Code: [Select]
players[GetPlayerStat(victim,'team')] := players[GetPlayerStat(victim,'team')] - 1;

error is : Type Mismatch a line bla bla

if a whole code can help i can post it here.
PLEASE HELP!!!
I'm going to write Tibia for Soldat

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Script Problem
« Reply #1 on: November 28, 2007, 12:24:39 pm »
And what is "players"? Or what are you trying to do?
urraka

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Script Problem
« Reply #2 on: November 28, 2007, 12:25:49 pm »
the whole code would help, a lot

btw, what variable type is players set to (array[1..#] of ???)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Script Problem
« Reply #3 on: November 28, 2007, 01:05:29 pm »
You can't use variants as an array index. Do something like this:

Code: [Select]
index:=GetPlayerStat(victim,'team');
players[index] := players[index] - 1;
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Script Problem
« Reply #4 on: November 28, 2007, 03:45:47 pm »
I just do Blarg[StrtoInt(InttoStr(GetPlayerStat(...)))] in case you don't want to make another variable..

Offline KwS Pall

  • Major(1)
  • Posts: 49
  • I'm going to write Tibia for Soldat
Re: Script Problem
« Reply #5 on: November 29, 2007, 08:21:44 am »
Thanks Avarax.

i was writing an procedure
Code: [Select]
OnEndRound(team : byte), but i realised that it won't work with bots, so i need some ppl to test it (test it soon)

bot it no give any errors
I'm going to write Tibia for Soldat