PDA

View Full Version : Enums help


PaulDinam
12/06/2013, 11:09 PM
I made something like that:

tCameraSpot and tCameraLookAt has three spaces, array.
I tried to set their variables through the new TutorialPlaces and it didn't work out.


enum TUT_SPOTS
{
Float:tCameraSpot[3],
Float:tCameraLookAt[3],
tText[128]
}

new TutorialPlaces[][TUT_SPOTS] = {
{1668.3604,-2308.7495,-0.1835, 1644.9135,-2329.9458,-2.6797, "Airport test 1"},
{1721.4801,-2264.8171,-0.1987, 1741.2997,-2251.1802,-2.8516,-2.6797, "Airport test 2"}
};

Vince
12/06/2013, 11:34 PM
You have an extra variable in your second line.

PaulDinam
12/06/2013, 11:38 PM
After I removed the extra variable, I have got this problem:


C:\Users\Paul\Desktop\Vision RolePlay\pawno\include\Server\Enums.pwn(22) : warning 213: tag mismatch
C:\Users\Paul\Desktop\Vision RolePlay\pawno\include\Server\Enums.pwn(22) : warning 227: more initiallers than enum fields

ReVo_
12/06/2013, 11:38 PM
enum TUT_SPOTS
{
Float:tCameraSpot[3],
Float:tCameraLookAt[3],
tText[128]
}

new TutorialPlaces[][TUT_SPOTS] = {
{{1668.3604,-2308.7495,-0.1835}, {1644.9135,-2329.9458,-2.6797}, "Airport test 1"},
{{1721.4801,-2264.8171,-0.1987}, {1741.2997,-2251.1802,-2.8516}, (-2.6797 what? delete this), "Airport test 2"}
};

PaulDinam
12/06/2013, 11:44 PM
So this is how it works , thank you kind sir.