Value from array is not number?
#1

Hi!

This is my array:

Код:
new Tuning_SpoilerData[][][] = {
{"Spoiler 1",200,1164},{"Spoiler 2",300,1163},{"Spoiler 3",400,1162}
};
I want to use the third value from array (as you can see it's integer) for object number. The problem is here:

Код:
		new ObjectID = CreateDynamicObject(Tuning_SpoilerData[row][2],0.0,0.0,0.0,0.0,0.0,0.0);
This line give me this error:

Код:
C:\Users\blabla\Desktop\CrazyStunts\gamemodes\CrazyStunts.pwn(613) : error 035: argument type mismatch (argument 1)
How to fix this?
Reply
#2

pawn Код:
enum eSpoilers {
SpoilerName[ 50 ],
FirstNumber,
SecondNumber
}
new Tuning_SpoilerData[][eSpoilers] = {
// add rows here
};

new ObjectID = CreateDynamicObject(Tuning_SpoilerData[row][SecondNumber],0.0,0.0,0.0,0.0,0.0,0.0);
If you do something like this maybe you avoid the problem
Reply
#3

The parameters of createdynamicobject is a integer instead of a string.
Reply
#4

The thing is, that printf("%d",Tuning_SpoilerData[row][2]); prints the right number. I tried with strval but no success.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)