01.11.2017, 21:03
You could add custom tags to variables while declaring, that's one way.
Here is what i mean:
There's another way of reading the variable as a string and then do a character check to determine its type.
Here is what i mean:
PHP Code:
new Integer:myInt;
new String:myString[256];
new Float:myFloat; // float already has it's tag
stock function({Integer, Float, String}:param, tag = tagof param) {
if (tag == tagof(Integer:)) {
// its an integer
}
else if (tag == tagof(String:)) {
// its a string
}
else if (tag == tagof(Float:)) {
// its a float
}
}