how do I check if a character has a certain skill?

mredge73

Member
the skill numbers go from 0 to 8201 for some reason looking at the mafia internal database.
to get a list you will have to do something like this:
Code:
for i from 1 upto 8500
{
skill it = to_skill(i);
if( have_skill( it ) )
	print(to_string(it));
}

This takes a while so some other way may be more efficient, you can replace the print() with an array of skills if you like.
 

Rinn

Developer
This'll be much more efficient:

Code:
skill [int] skills;
file_to_map("classskills.txt", skills);

void main()
{
    foreach i in skills
    {
        if(!have_skill(skills[i]))
        {
            remove skills[i];
        }
    }

    foreach i in skills
    {
        print(skills[i]);
    }
}
 
Top