SA-MP Forums Archive
enum in arguments - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: enum in arguments (/showthread.php?tid=337110)



enum in arguments - AirKite - 25.04.2012

Hi All... How make like this?

Simple:
pawn Code:
enum enum_test{
    test,
    test_string[128],
    lol
};
new test[123][enum_test];

Simple_test_int(count, enum_c) {
    return test[count][enum_c];
}
pawn Code:
warning 213: tag mismatch // in line: return test[count][enum_c]



Re: enum in arguments - @Riichard - 25.04.2012

try :
pawn Code:
enum enum_test{
    test,
    test_string[128],
    lol
};
new test[123][enum_test];
Simple_test_int(count, enum_c) {
return test[count][enum_c];{
}
}
I do not know if it works
haha xD.


Re: enum in arguments - WLSF - 25.04.2012

pawn Code:
enum enum_test{
    test,
    test_string[128],
    lol
};
new wii [ 123 ] [ enum_test ] ;

Simple_test_int ( count, enum_c )
{
    return wii [ count ] [ enum_c ] ;
}
Try this.


Re: enum in arguments - AirKite - 25.04.2012

Pff... what are you doing all? Warning says about ENUM

Simple_test_int(count, enum_c) in test[count][enum_c]

And i don't know how use enum in function arguments (pawn) for massive. (if it's possible)

UPD:

My solution:
pawn Code:
enum enum_test{
    test,
    test_string[128],
    lol
};
new test[123][enum_test];

Simple_test_int(count, const enum_c) {
    return test[count][enum_test:enum_c];
}