Jump to content
  • 0

Help on this .diff error for PCSkillUseEvent


Question

Posted

ive been tryin to figure our what's the prob here. Im not that good yet in scripting

 

/**
* Jezznar
* getskillname (skillid);
**/
BUILDIN_FUNC(getskillname)
 {
    int skill_id;
    char *skill_name;
        //get input skill_id
        if (!script_hasdata(st, 2)) {
        script_pushconststr(st, "null");
        return SCRIPT_CMD_SUCCESS;
        
    }
        skill_id = script_getnum(st, 2);
    
        if (!skill_get_index(skill_id)) {
        ShowError("script:conv_str: Unknown skill_id supplied.\"\n");
        script_pushconststr(st, "null");
        return SCRIPT_CMD_SUCCESS;
        
    }
    skill_name = (char *)aMalloc(SKILL_NAME_LENGTH * sizeof(char));
    memcpy(skill_name, skill_db[skill_get_index(skill_id)]->desc, SKILL_DESC_LENGTH);
    script_pushstr(st, skill_name);
    
        return SCRIPT_CMD_SUCCESS;
    }
 

image.png.2496d27d24a9316e0a8d062c67f956ef.png

1 answer to this question

Recommended Posts

  • 0
Posted

try

BUILDIN_FUNC(getskillname)
{
	int skill_id;
	//get input skill_id
	if (!script_hasdata(st, 2)) {
		script_pushconststr(st, "null");
		return SCRIPT_CMD_SUCCESS;

	}
	skill_id = script_getnum(st, 2);
	if (!skill_get_index(skill_id)) {
		ShowError("script:conv_str: Unknown skill_id supplied.\"\n");
		script_pushconststr(st, "null");
		return SCRIPT_CMD_SUCCESS;
	}
	script_pushstr(st, skill_db.find(skill_id)->desc);
	return SCRIPT_CMD_SUCCESS;
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...