Log in

View Full Version : Players[CurrentPlayer].Strings[0] Type Mismatich



Mr_Bum
12-02-2008, 10:16 AM
TreeType := Players[CurrentPlayer].Strings[0];
Failed when compiling
Line 105: [Error] (16499:46): Type mismatch in script

That is line 105.
This is players setup.
Players[1].Name := ''; // your runescape account
Players[1].Pass := ''; // your runescape password
Players[1].Nick := ''; // 3-4 letters of your runscape username
Players[1].Active := True; //In the script or not
Players[1].Integers[0] := 10; // Loads to do.
Players[1].Integers[1] := 5000; // Time between trees
Players[1].Strings[0] := 'Tree'; //Type of tree to cut. Leave blank if not wanted.
Players[1].Strings[1] := 'Oak'; //Type of tree to cut. Leave blank if not wanted.

TreeType : integer;// is a var


I searched but found nothing
Need help on how to fix this problen

ZephyrsFury
12-02-2008, 10:25 AM
Players.Strings is what it says... a string. TreeType is an integer. You can't assign a string to an integer variable.

mikevskater
12-02-2008, 01:16 PM
TreeType : string;// it should be a string

Change it to a string
Setting "a" to a "#" is basicly dividing by zero :spot:

Bam Bam
12-02-2008, 09:16 PM
TreeType : string;// it should be a string

Change it to a string
Setting "a" to a "#" is basicly dividing by zero :spot:

No its not. They are just incompatible variable types. In order to use them together they have to be converted by going along the lines of StrToInt to go from String to an integer, or IntToStr for conversions from an integer to a string.

Division has nothing to do with this.

Blumblebee
12-02-2008, 09:19 PM
I think he's trying to say its impossible to make an string = an integer, not meaning its acutally dividing by 0.

Timer
12-02-2008, 10:02 PM
I think he's trying to say its impossible to make an string = an integer, not meaning its acutally dividing by 0.

StrToIntDef?

Blumblebee
12-02-2008, 10:10 PM
haha I didnt say it wasnt possible I was just saying that Bam_Bam had misinterpeted the post above him.

Mr_Bum
12-03-2008, 07:25 AM
Thankyou very much. Forget to think of that lol