Okay, so I was trying to make this command, when all of a sudden, "map-server crashed".
Anyone know where I went wrong with this?
BUILDIN(getskillname) { TBL_PC *sd = script->rid2sd(st); uint16 skill_id; int index; if(!sd) return true; skill_id = script_getnum(st,2); if (!(index = skill->get_index(skill_id)) || skill->db[index].name == NULL) { ShowError("script_getskillname: Skill with id %d does not exist in the skill databasen", skill_id); return 0; } script->push_str((st)->stack, C_STR, skill->db[index].name); return true;}
My guess is:
script->push_str((st)->stack, C_STR, skill->db[index].name);
But, I don't know any other way to actually push the name, because skill->get_name(skill_id); is a const char.
Anyone know where I went wrong with this?
BUILDIN(getskillname) { TBL_PC *sd = script->rid2sd(st); uint16 skill_id; int index; if(!sd) return true; skill_id = script_getnum(st,2); if (!(index = skill->get_index(skill_id)) || skill->db[index].name == NULL) { ShowError("script_getskillname: Skill with id %d does not exist in the skill databasen", skill_id); return 0; } script->push_str((st)->stack, C_STR, skill->db[index].name); return true;}
My guess is:
script->push_str((st)->stack, C_STR, skill->db[index].name);
But, I don't know any other way to actually push the name, because skill->get_name(skill_id); is a const char.