Jump to content

kpcamber

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by kpcamber

  1. On 7/31/2023 at 5:09 AM, Tokei said:

    Ah, that's my bad, I apparently didn't remove the player check in the script function. Change it to:

    BUILDIN_FUNC(hateffect){
    #if PACKETVER_MAIN_NUM >= 20150507 || PACKETVER_RE_NUM >= 20150429 || defined(PACKETVER_ZERO)
     	int16 effectID = script_getnum(st,2);
     	bool enable = script_getnum(st,3) ? true : false;
     
    	// This is unecessary and annoying half the time
    	//if( effectID <= HAT_EF_MIN || effectID >= HAT_EF_MAX ){
    	//	ShowError( "buildin_hateffect: unsupported hat effect id %d\n", effectID );
    	//	return SCRIPT_CMD_FAILURE;
    	//}
     
    	struct block_list* bl;
    	bool send = true;
     
    	if (script_hasdata(st, 4)) {
    		bl = map_id2bl(script_getnum(st, 4));
     	}
    	else {
    		bl = map_id2bl(st->rid);
    		map_session_data* sd = BL_CAST(BL_PC, bl);
     
    		if (sd && sd->state.connect_new) {
    			send = false;
    		}
     	}
     
    	unit_hateffect(bl, effectID, enable, send);
    #endif
    	return SCRIPT_CMD_SUCCESS;
    }

    Thanks bro, it's working now.

×
×
  • Create New...