29.01.2019, 14:37
Hello everyone, I was wondering whether it is possible to make a function which would fetch data from an enum. I want to do this so I can access the enum's data in another file that I have included like this:
An example of what I want to achieve:
and then in another file I do this:
It is currently giving me an error in the included file that the symbol "Ply_Level" is undefined.
Would be glad if someone can help me solve this
Код:
// The main gamemode file #include "scripts/anotherfile.pwn"
Код:
// The main gamemode file
enum Ply_Data
{
Ply_Level,
Float:Ply_Armour
}
new Ply_Info[MAX_PLAYERS][Ply_Data];
FetchDataFromPly_Data(playerid, Ply_Data:data)
{
return Ply_Info[playerid][Ply_Data:data];
}
Код:
// The included file
hook OnPlayerConnect(playerid)
{
if(FetchDataFromPly_Data(playerid, Ply_Data:Ply_Level) > 0)
{
// Maybe set his level to 3 with a SetDataToPly_Data function??
}
}
Would be glad if someone can help me solve this



