Jump to content
  • 0

Character face forward


Question

Posted

any char face forward script or src working on latest version?

 

-	script	kdjhfksdjf	-1,{
OnPCLoginEvent:
	setdir DIR_SOUTH;
	end;
}

this is not working and if i use this i got error.

Quote

parse_line: expect command, missing function name or calling undeclared function
*    4 :        's'etdir DIR_SOUTH;

how to fix that ? or anyone can recommend new script or src side? thank you 

7 answers to this question

Recommended Posts

  • 0
Posted
On 12/11/2019 at 8:15 AM, ScarrFace said:

any char face forward script or src working on latest version?

 


-	script	kdjhfksdjf	-1,{
OnPCLoginEvent:
	setdir DIR_SOUTH;
	end;
}

this is not working and if i use this i got error.

how to fix that ? or anyone can recommend new script or src side? thank you 

to solve your error you need to declare setdir first in src/script.

 

BUILDIN_FUNC(setdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,4) ) {
        if ( data_isstring( script_getdata(st,4) ) )
            sd = map_nick2sd( script_getstr(st,4),false );
        else
            sd = map_id2sd( script_getnum(st,4) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,3) ) {
            value = script_getnum(st,3);
            if ( value < 0 || value > 2 )
                value = 0;
        }
        pc_setdir( sd, script_getnum(st,2), value );
        clif_changed_dir( &sd->bl, AREA );
    }
    return SCRIPT_CMD_SUCCESS;
}

BUILDIN_FUNC(checkdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,3) ) {
        if ( data_isstring( script_getdata(st,3) ) )
            sd = map_nick2sd( script_getstr(st,3),false );
        else
            sd = map_id2sd( script_getnum(st,3) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,2) )
            value = script_getnum(st,2);
        script_pushint( st, value > 0 ? sd->head_dir : sd->ud.dir );
    }
    return SCRIPT_CMD_SUCCESS;
}

  • MVP 1
  • 0
Posted
20 hours ago, BeWan said:

to solve your error you need to declare setdir first in src/script.

 

BUILDIN_FUNC(setdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,4) ) {
        if ( data_isstring( script_getdata(st,4) ) )
            sd = map_nick2sd( script_getstr(st,4),false );
        else
            sd = map_id2sd( script_getnum(st,4) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,3) ) {
            value = script_getnum(st,3);
            if ( value < 0 || value > 2 )
                value = 0;
        }
        pc_setdir( sd, script_getnum(st,2), value );
        clif_changed_dir( &sd->bl, AREA );
    }
    return SCRIPT_CMD_SUCCESS;
}

BUILDIN_FUNC(checkdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,3) ) {
        if ( data_isstring( script_getdata(st,3) ) )
            sd = map_nick2sd( script_getstr(st,3),false );
        else
            sd = map_id2sd( script_getnum(st,3) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,2) )
            value = script_getnum(st,2);
        script_pushint( st, value > 0 ? sd->head_dir : sd->ud.dir );
    }
    return SCRIPT_CMD_SUCCESS;
}

thank you so much!

  • 0
Posted

@Mael's thing is correct. No need for src mod and stuff because it is already implemented in rAthena since 2014.

// When a player teleports, changes maps, or logs in, will they face the direction they were facing before warped?
// Official: Disabled, players always face North.
spawn_direction: 0

just set spawn_direction to 1.

  • 0
Posted
1 hour ago, Mabuhay said:

@Mael's thing is correct. No need for src mod and stuff because it is already implemented in rAthena since 2014.


// When a player teleports, changes maps, or logs in, will they face the direction they were facing before warped?
// Official: Disabled, players always face North.
spawn_direction: 0

just set spawn_direction to 1.

try to char select and log in

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...